123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512 |
- <template>
- <view>
- <scroll-view
- ref="scrollView"
- scroll-y="true"
- scroll-with-animation="true"
- style="min-height: 100%"
- :scroll-into-view="toView"
- >
-
-
- <u-navbar :safeAreaInsetTop="true" :placeholder="true">
- <view class="u-nav-slot u-flex" slot="left" style="display: flex">
- <view class="u-flex">
- <u-icon
- name="arrow-left"
- size="19"
- @click="navigateBack()"
- ></u-icon>
- <u-tabs
- :duration="duration"
- @click="scrollToPosition"
- :list="list1"
- lineColor="#fff"
- :activeStyle="{ color: '#FF1515' }"
- :inactiveStyle="{
- color: ' #666666',
- }"
- ></u-tabs>
- </view>
-
- </view>
- <view class="u-nav-slot u-flex" slot="right" style="display: flex">
- <view class="" style="margin-left: 184rpx" @click="share = true">
- <image
- src="static/images/share.png"
- style="width: 38rpx; height: 38rpx"
- mode=""
- ></image>
- </view>
- <view class="" style="width: 180rpx"></view>
- </view>
- </u-navbar>
-
- <view class="uni-margin-wrap" id="scroll0">
- <swiper
- class="swiper"
- circular
- :indicator-dots="false"
- :autoplay="true"
- >
- <swiper-item v-if="goodinfo.video">
- <video
- style="width: 750rpx; height: 750rpx"
- :src="goodinfo.video"
- ></video>
- </swiper-item>
- <swiper-item
- v-for="(item, idx) in goodinfo.images.split(',')"
- :key="idx"
- >
- <image
- :src="goodinfo.image"
- style="width: 750rpx; height: 750rpx"
- mode=""
- ></image>
- </swiper-item>
- </swiper>
- </view>
- <view class="back">
-
- <view class="discount">
- <view class="top">
- <text class="count" v-if="goodinfo.is_discount == 0">{{
- i18n.Discounted
- }}</text>
- <text class="money">¥</text>
- <text class="money" style="font-size: 48rpx">{{
- goodinfo.is_discount == 0
- ? goodinfo.discount_price.slice(0, -3)
- : goodinfo.price.slice(0, -3)
- }}</text>
- <text class="money">{{
- goodinfo.is_discount == 0
- ? goodinfo.discount_price.slice(-3)
- : goodinfo.price.slice(-3)
- }}</text>
- <text class="right" v-if="goodinfo.is_discount == 0"
- >¥{{ goodinfo.price }}</text
- >
- </view>
- <view class="bottom">
- <text class="tabs">{{ i18n.sametype }}</text>
- <view class="title">
- <text
- class="title"
- selectable
- @longpress="onLongPress"
- v-if="language == 'zh-CN'"
- >
- {{ goodinfo.name_cn }}
- </text>
- <text
- class="title"
- selectable
- @longpress="onLongPress"
- v-if="language == 'en-US'"
- >
- {{ goodinfo.name_en }}
- </text>
- <text
- class="title"
- selectable
- @longpress="onLongPress"
- v-if="language == 'es-ES'"
- >
- {{ goodinfo.name_es }}
- </text>
- <text
- class="title"
- selectable
- @longpress="onLongPress"
- v-if="language == 'it-IT'"
- >
- {{ goodinfo.name_ita }}
- </text>
- </view>
- </view>
- </view>
-
- <view class="serve" style="margin-top: 20rpx">
- <view class="top u-flex u-row-between" @click="sele">
- <view class="u-flex">
- <view class="change">{{ i18n.Sele }}</view>
- <view class="" style="margin-left: 20rpx">
- {{ selectArr.length > 0 ? selectArr.join(",") : i18n.Sele }}
- </view>
- </view>
- <view class="">
- <u-icon name="arrow-right" size="16"></u-icon>
- </view>
- </view>
- <view
- class="top u-flex u-row-between"
- style="margin-top: 36rpx"
- @click="serve = true"
- >
- <view class="u-flex">
- <view class="change">{{ i18n.service }}</view>
- <view class="" style="margin-left: 20rpx"
- >正品保障 · 极速退款 · 7天无理由退</view
- >
- </view>
- <view class="">
- <u-icon name="arrow-right" size="16"></u-icon>
- </view>
- </view>
- </view>
-
- <view class="comment" ref="targetPosition" id="scroll1">
- <view class="u-flex u-row-between">
- <text class="ping">{{ i18n.review }}</text>
- <view class="u-flex" @click="tocomment">
- <text class="strip"
- >{{ total }}{{ i18n.article + i18n.review }}</text
- >
- <u-icon name="arrow-right" size="16"></u-icon>
- </view>
- </view>
- <view class="" v-for="(item, idx) in commentlist" :key="idx">
- <view class="uesr u-flex u-row-between" style="margin-top: 36rpx">
- <view class="u-flex">
- <image
- src="../static/images/logo.png"
- style="width: 52rpx; height: 52rpx"
- mode=""
- >
- </image>
- <text class="name">{{ item.member.nickname }}</text>
- </view>
- <text class="strip">{{ item.created_at }}</text>
- </view>
- <view class="content">
- {{ item.content }}
- </view>
- <view class="sku" style="margin-top: 16rpx">{{
- item.sku_item.item
- }}</view>
- </view>
- </view>
-
- <view class="store u-flex u-row-between">
- <view class="u-flex">
- <image
- :src="goodinfo.merchant.image"
- style="width: 112rpx; height: 112rpx"
- mode=""
- ></image>
- <view class="" style="margin-left: 20rpx">
- <view class="title">{{ goodinfo.merchant.merchant_name }}</view>
- <view class="redback u-flex">
- <uni-rate
- network
- allow-half
- :readonly="true"
- active-color="red"
- color="rgba(255, 27, 0, 0.5)"
- :size="8"
- :value="5"
- v-model="rate"
- />
- <text style="margin-left: 8rpx">{{ rate }}</text>
- </view>
- <view class="" style="margin-top: 20rpx"></view>
- <view class="u-flex" style="margin-top: 20rpx">
- <text class="num">{{ i18n.Salesvolume }} 2384w+</text>
- <view class="line"></view>
-
- <text class="num">{{ i18n.Salesvolume }} 2384w+</text>
- </view>
- </view>
- </view>
- <view class="goshop" @click="goshop">{{ i18n.stroll }}</view>
- </view>
-
- <view class="recommend">
- <view class="title">
- {{ i18n.Recommended }}
- </view>
- <view class="">
- <swiper
- style="height: 400rpx"
- class="swiper"
- circular
- :indicator-dots="true"
- :autoplay="true"
- >
- <swiper-item v-for="(parent, index) in swiptlist" :key="index">
- <view class="u-flex swiper-item u-row-between">
- <view
- class=""
- v-for="(child, idx) in parent"
- @click="detail(child.id)"
- :key="idx"
- >
- <image
- :src="child.image"
- style="width: 214rpx; height: 214rpx"
- mode=""
- >
- </image>
- <view
- class="u-line-1"
- style="
- width: 214rpx;
- margin-top: 14rpx;
- font-style: normal;
- font-size: 26rpx;
- "
- v-if="language == 'zh-CN'"
- >
- {{ child.name_cn }}
- </view>
- <view
- class="u-line-1"
- style="
- width: 214rpx;
- margin-top: 14rpx;
- font-style: normal;
- font-size: 26rpx;
- "
- v-if="language == 'en-US'"
- >
- {{ child.name_en }}
- </view>
- <view
- class="u-line-1"
- style="
- width: 214rpx;
- margin-top: 14rpx;
- font-style: normal;
- font-size: 26rpx;
- "
- v-if="language == 'es-ES'"
- >
- {{ child.name_es }}
- </view>
- <view
- class="u-line-1"
- style="
- width: 214rpx;
- margin-top: 14rpx;
- font-style: normal;
- font-size: 26rpx;
- "
- v-if="language == 'it-IT'"
- >
- {{ child.name_ita }}
- </view>
- <view class="" style="margin-top: 12rpx">
- <span style="color: rgba(204, 51, 0, 1); font-size: 26rpx"
- >¥{{ child.price }}</span
- >
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- </view>
- </view>
- <view class="recommend" id="scroll2">
- <view class="title">{{ i18n.Productdetails }}</view>
- <view class="" style="margin-top: 32rpx; margin-bottom: 28rpx">{{
- i18n.Specification
- }}</view>
- <view class="specification">
- <view
- class="item u-flex"
- style="margin-bottom: 28rpx"
- v-for="(item, idx) in goodinfo.parameter"
- :key="idx"
- >
- <view style="width: 150rpx">{{ item.name }}</view>
- <text style="margin-left: 58rpx">{{ item.value }}</text>
- </view>
- </view>
- <view class="">
- <image
- :src="goodinfo.image"
- style="width: 100%; height: 580rpx"
- mode=""
- ></image>
- </view>
- </view>
- <view class="" style="height: 158rpx"></view>
- <view class="fix u-flex u-row-between">
- <view class="u-flex" style="column-gap: 35rpx">
- <view
- class="u-flex"
- style="justify-content: center; flex-direction: column"
- >
- <image
- src="../static/images/index/service.png"
- style="width: 40rpx; height: 40rpx"
- mode=""
- >
- </image>
- <view class="ke">{{ i18n.Customer }}</view>
- </view>
- <view
- class="u-flex"
- style="justify-content: center; flex-direction: column"
- @click="shopping"
- >
- <image
- src="../static/cart1.png"
- style="width: 40rpx; height: 40rpx"
- mode=""
- ></image>
- <view class="ke">{{ i18n.Shopping }}</view>
- </view>
- <view
- class="u-flex"
- style="
- justify-content: center;
- flex-direction: column;
- width: 70rpx;
- "
- @click="fllow"
- >
- <image
- v-if="goodinfo.is_interest == 1"
- src="../static/images/index/attention.png"
- style="width: 40rpx; height: 40rpx"
- mode=""
- ></image>
- <image
- v-if="goodinfo.is_interest == 0"
- src="../static/images/index/bottom1.png"
- style="width: 40rpx; height: 40rpx"
- mode=""
- >
- </image>
- <view v-if="goodinfo.is_interest == 1" class="ke">{{
- i18n.follow
- }}</view>
- <view
- v-if="goodinfo.is_interest == 0"
- class="ke"
- style="color: rgba(248, 50, 36, 1)"
- >已关注
- </view>
- </view>
- </view>
- <view
- v-if="sku_info.stock_total == 0"
- class="tongzhi"
- @click="inform"
- >
- {{ i18n.notification }}
- </view>
- <view v-if="sku_info.stock_total != 0" class="join" @click="join(0)"
- >加入购物车</view
- >
- <view v-if="sku_info.stock_total != 0" class="pin" @click="join(1)"
- >立即拼团</view
- >
- </view>
- </view>
- </scroll-view>
-
- <u-popup :round="10" :show="show">
- <view
- style="padding: 48rpx 28rpx; box-sizing: border-box; position: relative"
- >
- <view class="u-flex">
- <image
- :src="goodinfo.image"
- style="width: 192rpx; height: 192rpx"
- mode=""
- ></image>
- <view class="" style="margin-left: 20rpx">
- <view class="">
- <text class="read">¥</text>
- <text
- class="read"
- style="font-size: 40rpx"
- v-if="goodinfo.is_discount == 0"
- >{{
- (Number(sku_info.discount_price * 100) *
- Number(value * 100)) /
- 10000 ||
- (Number(goodinfo.discount_price * 100) *
- Number(value * 100)) /
- 10000
- }}</text
- >
- {{(goodinfo.discount_price * value).slice(-3)}}
- <text
- class="read"
- style="font-size: 40rpx"
- v-if="goodinfo.is_discount == 1"
- >{{
- (Number(sku_info.price * 100) * Number(value * 100)) /
- 10000 ||
- (Number(goodinfo.price * 100) * Number(value * 100)) / 10000
- }}</text
- >
- {{(goodinfo.price * value).slice(-3)}}
- {{(Number(goodinfo.price) * Number(value)).toString()}}
- </view>
- <text class="guige"
- >已选:{{ selectArr.join(",") || i18n.selection }}</text
- >
- </view>
- </view>
- <view
- class=""
- style="position: absolute; top: 48rpx; right: 28rpx"
- @click="show = false"
- >
- <u-icon
- name="close"
- @click="show == false"
- color="#000"
- size="28"
- ></u-icon>
- </view>
- <view class="" v-for="(item, index) in goodinfo.sku">
- <view class="title1" style="margin-top: 40rpx; margin-bottom: 32rpx">
- {{ item.name }}
- </view>
- <view class="u-flex" style="column-gap: 18rpx; flex-wrap: wrap">
- <view
- class=""
- :class="selectArr[index] == child ? 'acttab' : 'tabs'"
- v-for="(child, idx) in item.values"
- :key="idx"
- @click="actabs(index, child, item)"
- >
- {{ child }}
- </view>
- </view>
- </view>
- <view class="u-flex u-row-between" style="margin-top: 30rpx">
- <text class="title1">数量</text>
- <u-number-box v-model="value" @change="valChange"></u-number-box>
- </view>
- <view class="" style="height: 200rpx"></view>
- <view class="bottoma">
- <view v-if="shopcar == 0" class="btn" @click="joincart">
- 加入购物车
- </view>
- <view v-if="shopcar == 1" class="btn" @click="order"> 立即购买 </view>
- <view v-if="shopcar == 2" class="btn" @click="show = false">
- 确定
- </view>
- </view>
- </view>
- </u-popup>
- <u-popup :show="serve" :round="20">
- <view
- style="
- padding: 48rpx 24rpx;
- box-sizing: border-box;
- background-color: #fff3e7;
- position: relative;
- border-radius: 20rpx 20rpx 0 0;
- "
- >
- <view
- class="u-flex"
- style="flex-direction: column; justify-content: center"
- >
- <image
- src="../static/images/index/serve.png"
- style="width: 138rpx; height: 34rpx"
- mode=""
- ></image>
- <text class="info"> 售前售后 安心无忧购物 </text>
- </view>
- <view
- class=""
- style="position: absolute; top: 48rpx; right: 24rpx"
- @click="serve = false"
- >
- <u-icon name="close" style="width: 22rpx; height: 22rpx"></u-icon>
- </view>
- <view class="contenta">
- <view class="">
- <view class="title">丢包丢件</view>
- <view class="content"
- >快件如果在运输过程中出现损毁,将按照保价</view
- >
- </view>
- <view class="" style="margin-top: 36rpx">
- <view class="title">丢包丢件</view>
- <view class="content"
- >快件如果在运输过程中出现损毁,将按照保价</view
- >
- </view>
- <view class="" style="margin-top: 36rpx">
- <view class="title">丢包丢件</view>
- <view class="content"
- >快件如果在运输过程中出现损毁,将按照保价</view
- >
- </view>
- </view>
- <view class="button" @click="serve = false">
- {{ i18n.know }}
- </view>
- </view>
- </u-popup>
- <u-popup :round="10" :show="share" bgColor=" rgba(244, 244, 244, 1);">
- <view
- style="
- padding: 48rpx 24rpx;
- box-sizing: border-box;
- background-color: rgba(244, 244, 244, 1);
- border-radius: 10px 10px 0 0;
- "
- >
- <view class="u-flex u-row-between" style="">
- <view class="" style="width: 28px; height: 28px"></view>
- <text class="info" style="font-size: 32rpx">
- {{ i18n.shar }}
- </text>
- <image
- src="../static/images/index/bottom2.png"
- style="width: 40rpx; height: 40rpx"
- >
- </image>
- </view>
-
- <view
- class="u-flex u-row-between"
- style="margin-top: 82rpx; padding: 0 140rpx"
- >
- <view class="">
- <image
- src="../static/images/index/link.png"
- style="width: 108rpx; height: 108rpx"
- mode=""
- >
- </image>
- <view class="link">{{ i18n.Copylink }}</view>
- </view>
- <view class="" @click="builder">
- <image
- src="../static/images/index/image.png"
- style="width: 108rpx; height: 108rpx"
- mode=""
- >
- </image>
- <view class="link">{{ i18n.Generatepicture }}</view>
- </view>
- </view>
- <view
- class="button"
- @click="share = false"
- style="background: #fff; color: #555555; margin-top: 58rpx"
- >
- {{ i18n.Cancel }}
- </view>
- </view>
- </u-popup>
- <u-popup
- :show="imagea"
- bgColor=" rgba(244, 244, 244, 0);"
- mode="center"
- :customStyle="{ alignItems: 'center' }"
- >
- <view
- class="u-fle"
- style="display: flex; justify-content: flex-end; width: 100%"
- >
- <u-icon
- name="close"
- @click="imagea == false"
- color="#fff"
- size="28"
- ></u-icon>
- </view>
- <view
- style="
- padding: 48rpx 24rpx;
- box-sizing: border-box;
- background-color: rgba(255, 255, 255, 1);
- border-radius: 16rpx;
- width: 538rpx;
- "
- >
- <view class="" style="">
- <image
- src="../static/images/index/bottom2.png"
- style="width: 490rpx; height: 490rpx"
- ></image>
- </view>
- <view class="money">
- <span>¥</span>
- <span style="font-size: 36rpx">258</span>
- <span>00</span>
- </view>
- <view class="title">布兰德低温烘焙猫粮全价通用高端鲜肉成猫幼</view>
- <view
- class=""
- style="
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- margin-top: 44rpx;
- "
- >
- <image
- src="../static/images/logo.png"
- style="width: 132rpx; height: 132rpx"
- mode=""
- ></image>
- <view class="view">长按识别查看</view>
- </view>
- </view>
- <view class="button" style="width: 658rpx">保存到相册</view>
- </u-popup>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- toView: "",
- imagea: false,
- list1: [
- {
- name: "商品",
- },
- {
- name: "评价",
- },
- {
- name: "详情",
- },
- ],
- current: 0,
-
- show: false,
-
- serve: false,
-
- share: false,
- value: 1,
- swiptlist: [],
- actab: 0,
- id: "",
- language: "",
- goodinfo: {},
- duration: 0,
- actidx: 0,
- subIndex: [],
- selectArr: [],
- shopcar: "",
- sku_info: {},
- commentlist: [],
- total: "",
- rate: 5,
- };
- },
- computed: {
- i18n() {
- return this.$t("index");
- },
- },
- onLoad(options) {
- this.id = options.id;
- this.comment();
- },
- onShow() {
- if (uni.getStorageSync("language") != "") {
- this.language = uni.getStorageSync("language");
- }
- this.detail(this.id);
- this.recommend();
- },
- methods: {
-
- tocomment() {
- uni.navigateTo({
- url: "/pageA/comment?id=" + this.goodinfo.merchant_goods_id,
- });
- },
-
- fllow() {
- uni.$u.http
- .post("/api/interest/follow", {
- interest_type: 0,
- interest_id: this.goodinfo.merchant_goods_id,
- })
- .then((res) => {
- if (res == "ok1") {
- this.$u.toast("取关成功");
- this.detail(this.id);
- } else {
- this.$u.toast("关注成功");
- this.detail(this.id);
- }
- })
- .catch(() => {});
- },
- sele() {
- this.shopcar = 2;
- this.show = true;
- },
-
- shopping() {
- uni.switchTab({
- url: "/pages/cart/cart",
- });
- },
-
- comment() {
- uni.$u.http
- .post("/api/goods/goods_comment", {
- merchant_goods_id: this.goodinfo.merchant_goods_id,
- page: 1,
- limit: 2,
- })
- .then((res) => {
- this.commentlist = res.data;
- this.total = res.total;
- })
- .catch(() => {});
- },
-
- recommend() {
- uni.$u.http
- .post("/api/goods/recommend", {
- keyword: "",
- })
- .then((res) => {
- this.swiptlist = res.reduce(
- (a, b) => {
- let lastIndex = a.length - 1;
- if (a[lastIndex].length < 3) {
- a[lastIndex].push(b);
- } else {
- a.push([b]);
- }
- return a;
- },
- [[]]
- );
- })
- .catch(() => {});
- },
- scrollToPosition(e) {
- console.log(e);
- this.current = e.index;
- setTimeout(() => {
- this.toView = "scroll" + e.index;
- }, 200);
- },
-
- goshop() {
- uni.navigateTo({
- url: "/pageD/homepage/homepage",
- });
- },
- detail(id) {
- uni.$u.http
- .get("/api/goods/detail/" + id)
- .then((res) => {
- console.log(res);
- this.goodinfo = res;
- this.comment();
- this.rate = res.merchant.score;
- })
- .catch(() => {});
- },
-
-
-
-
-
-
-
- actabs(index, child, idx) {
-
-
- console.log(this.selectArr);
- if (this.selectArr[index] != child) {
- this.$set(this.selectArr, index, child);
- this.$set(this.subIndex, index, idx);
- } else {
- this.$set(this.selectArr, index, "");
- this.$set(this.subIndex, index, -1); //去掉选中颜色
- }
- this.goodinfo.sku_item.forEach((ite) => {
- console.log(ite.item);
- console.log(this.selectArr.join(","));
- if (ite.item == this.selectArr.join(",")) {
- this.sku_info = ite;
- }
- });
- console.log(this.sku_info);
- },
- order() {
- if (this.sku_info.stock_total != 0) {
- uni.navigateTo({
- url:
- "/pageA/order?sku=" +
- encodeURIComponent(JSON.stringify(this.sku_info)) +
- "&value=" +
- this.value +
- "&goodinfo=" +
- encodeURIComponent(JSON.stringify(this.goodinfo)),
- });
- } else {
- this.$u.toast("库存为0");
- this.show = false;
- }
-
- },
-
- builder() {
- this.imagea = true;
- this.share = false;
- },
-
- joincart() {
- this.show = false;
- if (this.sku_info.stock_total == 0) {
- this.$u.toast("添加失败,库存为0");
- } else {
- uni.$u.http
- .post("/api/cart/save", {
- goods_id: this.id,
- goods_num: this.value,
- sku_item_id: this.sku_info.id,
- merchant_goods_id: this.goodinfo.merchant_goods_id,
- belong: this.goodinfo.source,
- share_merchant_id: "",
- })
- .then((res) => {
- this.$u.toast("添加成功");
- })
- .catch(() => {});
- }
- },
- valChange(e) {
- return e.value;
- },
- navigateBack() {
- uni.navigateBack();
- },
- join(index) {
- this.show = true;
- this.shopcar = index;
- },
-
- inform() {
- uni.showToast({
- title: this.i18n.shelves,
- icon: "none",
- duration: 2000,
- });
- },
-
- onLongPress(e) {
-
- let text = e.target.innerText;
- console.log(e);
-
- uni.setClipboardData({
- data: text,
- success: () => {
- uni.showToast({
- title: this.i18n.Copiedpaste,
- duration: 2000,
- });
- },
- fail: () => {
- uni.showToast({
- title: this.i18n.Replicationfailure,
- icon: "none",
- duration: 2000,
- });
- },
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .redback {
- background: rgba(255, 27, 0, 0.07);
- border-radius: 12rpx;
- padding: 6rpx 12rpx;
- box-sizing: border-box;
- font-family: HarmonyOS_Sans_Medium;
- font-size: 16rpx;
- color: #ff1515;
- line-height: 22rpx;
- text-align: left;
- font-style: normal;
- width: 200rpx;
- }
- .sku {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #888888;
- line-height: 28rpx;
- text-align: left;
- font-style: normal;
- }
- .acttab {
- height: 68rpx;
- padding: 14rpx 30rpx;
- text-align: center;
- box-sizing: border-box;
- display: inline;
- background: rgba(248, 50, 36, 0.06);
- border-radius: 6rpx;
- border: 2rpx solid #f83224;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #f83224;
- line-height: 40rpx;
- }
- .read {
- font-family: HarmonyOS_Sans_Medium;
- font-size: 26rpx;
- color: #f83224;
- line-height: 36rpx;
- text-align: left;
- font-style: normal;
- }
- // ::v-deep .u-popup__content{
- // background-color: rgba(0,0,0,0) !important;
- // }
- .money {
- font-family: HarmonyOS_Sans_Medium;
- font-size: 20rpx;
- color: #f83224;
- line-height: 26rpx;
- text-align: left;
- font-style: normal;
- }
- .title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #222222;
- line-height: 40rpx;
- text-align: left;
- font-style: normal;
- margin-top: 16rpx;
- }
- .view {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #777777;
- line-height: 28rpx;
- text-align: left;
- font-style: normal;
- margin-top: 12rpx;
- }
- .actabs {
- width: 116rpx;
- height: 68rpx;
- background: rgba(248, 50, 36, 0.06);
- border-radius: 6rpx;
- border: 2rpx solid #f83224;
- }
- .bottoma {
- width: 750rpx;
- height: 166rpx;
- background: #ffffff;
- padding: 16rpx 44rpx 0;
- position: fixed;
- bottom: 0;
- left: 0;
- .btn {
- width: 662rpx;
- height: 84rpx;
- background: #f83224;
- border-radius: 44rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #ffffff;
- line-height: 84rpx;
- text-align: center;
- font-style: normal;
- }
- }
- .title1 {
- font-family: PingFangSC, PingFang SC;
- font-weight: 550;
- font-size: 32rpx;
- color: #222222;
- line-height: 44rpx;
- text-align: left;
- font-style: normal;
- }
- .tabs {
- // width: 276rpx;
- height: 68rpx;
- padding: 14rpx 30rpx;
- text-align: center;
- background: #f4f4f4;
- border-radius: 6rpx;
- box-sizing: border-box;
- display: inline;
- font-size: 28rpx;
- border: 2rpx solid rgba(151, 151, 151, 0);
- line-height: 40rpx;
- // line-height: 68rpx;
- }
- .link {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #555555;
- line-height: 40rpx;
- text-align: left;
- font-style: normal;
- margin-top: 16rpx;
- }
- .tongzhi {
- width: 422rpx;
- height: 76rpx;
- background: #ffb515;
- border-radius: 40rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #ffffff;
- line-height: 76rpx;
- text-align: center;
- font-style: normal;
- }
- .info {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #222222;
- line-height: 28rpx;
- text-align: left;
- font-style: normal;
- margin-top: 18rpx;
- }
- .button {
- // width: 662rpx;
- height: 88rpx;
- background: #f83224;
- border-radius: 44rpx;
- margin-top: 24rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 32rpx;
- color: #ffffff;
- line-height: 88rpx;
- text-align: center;
- font-style: normal;
- }
- .contenta {
- width: 702rpx;
- // height: 590rpx;
- background: #ffffff;
- border-radius: 20rpx;
- margin-top: 26rpx;
- padding: 28rpx 24rpx;
- box-sizing: border-box;
- .title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 30rpx;
- color: #222222;
- line-height: 42rpx;
- text-align: left;
- font-style: normal;
- }
- .content {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: rgba(34, 34, 34, 0.5);
- line-height: 36rpx;
- text-align: left;
- font-style: normal;
- margin-top: 20rpx;
- }
- }
- .back {
- background-color: #f4f4f4;
- padding: 20rpx;
- box-sizing: border-box;
- .guige {
- }
- .fix {
- width: 750rpx;
- height: 158rpx;
- background: #ffffff;
- padding: 14rpx 28rpx;
- box-sizing: border-box;
- position: fixed;
- bottom: 0;
- left: 0;
- .ke {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #333333;
- line-height: 28rpx;
- text-align: left;
- font-style: normal;
- }
- .join {
- width: 208rpx;
- height: 76rpx;
- border-radius: 40rpx;
- border: 1rpx solid #ff1515;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #f83224;
- line-height: 76rpx;
- text-align: left;
- font-style: normal;
- text-align: center;
- }
- .pin {
- width: 208rpx;
- height: 76rpx;
- background: #f83224;
- border-radius: 40rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #ffffff;
- line-height: 76rpx;
- text-align: center;
- font-style: normal;
- }
- }
- // 规格
- .specification {
- width: 670rpx;
- // height: 280rpx;
- background: #f4f4f4;
- padding: 24rpx 22rpx;
- box-sizing: border-box;
- view:last-of-type {
- margin-bottom: 0rpx !important;
- }
- .item {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #333333;
- line-height: 36rpx;
- text-align: left;
- font-style: normal;
- }
- }
- // 推荐
- .recommend {
- width: 710rpx;
- // height: 476rpx;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 24rpx 20rpx;
- margin-top: 20rpx;
- box-sizing: border-box;
- .title {
- font-family: PingFangSC, PingFang SC;
- font-weight: 550;
- font-size: 28rpx;
- color: #222222;
- line-height: 40rpx;
- text-align: left;
- font-style: normal;
- }
- }
- //店铺
- .store {
- width: 710rpx;
- height: 160rpx;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 24rpx 20rpx;
- box-sizing: border-box;
- margin-top: 20rpx;
- .line {
- background: rgba(151, 151, 151, 1);
- width: 4rpx;
- height: 20rpx;
- margin: 0 18rpx;
- }
- .num {
- font-family: SFPro, SFPro;
- font-weight: 400;
- font-size: 20rpx;
- color: #777777;
- line-height: 24rpx;
- text-align: left;
- font-style: normal;
- }
- .goshop {
- // width: 108rpx;
- height: 52rpx;
- border-radius: 26rpx;
- border: 1rpx solid #ff1515;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #f83224;
- line-height: 52rpx;
- text-align: center;
- font-style: normal;
- padding: 0 20rpx;
- box-sizing: border-box;
- }
- }
- // 评论
- .comment {
- width: 710rpx;
- // height: 356rpx;
- background: #ffffff;
- border-radius: 16rpx;
- margin-top: 20rpx;
- padding: 24rpx 20rpx;
- box-sizing: border-box;
- .content {
- margin-top: 20rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #444444;
- line-height: 36rpx;
- text-align: left;
- font-style: normal;
- max-height: 112rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: wrap;
- -webkit-line-clamp: 3;
- }
- .name {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #222222;
- line-height: 34rpx;
- text-align: left;
- font-style: normal;
- margin-left: 16rpx;
- }
- .ping {
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #222222;
- line-height: 40rpx;
- text-align: left;
- font-style: normal;
- }
- .strip {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #444444;
- line-height: 34rpx;
- text-align: left;
- font-style: normal;
- }
- }
- //服务
- .serve {
- width: 710rpx;
- height: 180rpx;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 32rpx 20rpx;
- box-sizing: border-box;
- .top {
- .change {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #666666;
- line-height: 40rpx;
- text-align: left;
- font-style: normal;
- }
- }
- }
- //折扣
- .discount {
- position: relative;
- height: 312rpx;
- .top {
- width: 710rpx;
- height: 124rpx;
- background: linear-gradient(295deg, #fb6662 0%, #fd403b 100%);
- border-radius: 16rpx 16rpx 0 0;
- padding: 20rpx;
- box-sizing: border-box;
- line-height: 98rpx;
- .count {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #ffffff;
- text-align: left;
- font-style: normal;
- }
- .money {
- font-size: 20rpx;
- font-family: HarmonyOS_Sans_Medium;
- font-size: 20rpx;
- color: #ffffff;
- text-align: left;
- font-style: normal;
- margin-left: 8rpx;
- }
- .right {
- font-family: HarmonyOS_Sans;
- font-size: 24rpx;
- color: #ffffff;
- text-align: left;
- font-style: normal;
- text-decoration-line: line-through;
- margin-left: 16rpx;
- }
- }
- .bottom {
- width: 710rpx;
- height: 208rpx;
- background: #ffffff;
- border-radius: 16rpx;
- position: absolute;
- top: 104rpx;
- z-index: 2;
- padding: 28rpx 20rpx;
- box-sizing: border-box;
- .title {
- margin-top: 24rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 550;
- font-size: 32rpx;
- color: #222222;
- line-height: 44rpx;
- text-align: left;
- font-style: normal;
- }
- }
- .tabs {
- // width: 104rpx;
- height: 40rpx;
- background: rgba(255, 21, 21, 0.1);
- border-radius: 4rpx;
- padding: 4rpx 8rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 22rpx;
- color: #ff1515;
- line-height: 40rpx;
- text-align: center;
- font-style: normal;
- }
- }
- }
- // 轮播图
- .uni-margin-wrap {
- width: 750rpx;
- width: 100%;
- .swiper {
- height: 750rpx;
- }
- .swiper-item {
- display: block;
- height: 300rpx;
- line-height: 300rpx;
- text-align: center;
- }
- .swiper-list {
- margin-top: 40rpx;
- margin-bottom: 0;
- }
- .uni-common-mt {
- margin-top: 60rpx;
- position: relative;
- }
- .info {
- position: absolute;
- right: 20rpx;
- }
- .uni-padding-wrap {
- width: 550rpx;
- padding: 0 100rpx;
- }
- }
- ::v-deep .u-popup__content data-v-17becaea {
- align-items: center !important;
- }
- </style>
|