index.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. <template>
  2. <!-- 商品列表 -->
  3. <view :style="colorStyle">
  4. <view class='productList'>
  5. <!-- #ifdef MP -->
  6. <view class="header" :style="'height:'+(menuButton.top+menuButton.height+47)+'px;'">
  7. <view class="acea-row row-center-wrapper" :style="'height:'+menuButton.height+'px;margin-top:'+menuButton.top+'px;'">
  8. <view class="bnt acea-row row-center-wrapper" :style="'height:'+menuButton.height+'px;width:'+menuButton.width+'px;top:'+menuButton.top+'px;'">
  9. <text class="iconfont icon-fanhui2" @click="returnPage"></text>
  10. <text class="lines"></text>
  11. <text class="iconfont icon-gengduo5" @click="moreNav"></text>
  12. </view>
  13. <view class="title">商品列表</view>
  14. </view>
  15. <view class="searchMp acea-row row-between-wrapper">
  16. <view class='input acea-row row-between-wrapper' :class="promotions_type?'on':''"><text
  17. class='iconfont icon-sousuo'></text>
  18. <input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
  19. :value='where.keyword' @confirm="searchSubmit"></input>
  20. </view>
  21. <view class='iconfont' v-if="!promotions_type"
  22. :class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- #endif -->
  27. <!-- #ifndef MP -->
  28. <view class='search bg-color acea-row row-between-wrapper'>
  29. <view class='input acea-row row-between-wrapper' :class="promotions_type?'on':''"><text
  30. class='iconfont icon-sousuo'></text>
  31. <input placeholder='搜索商品名称' placeholder-class='placeholder' confirm-type='search' name="search"
  32. :value='where.keyword' @confirm="searchSubmit"></input>
  33. </view>
  34. <view class='iconfont' v-if="!promotions_type"
  35. :class='is_switch==true?"icon-pailie":"icon-tupianpailie"' @click='Changswitch'>
  36. </view>
  37. </view>
  38. <!-- #endif -->
  39. <!-- #ifdef MP -->
  40. <view class='nav acea-row row-middle row-around' :style="'margin-top:'+(menuButton.top+menuButton.height+47)+'px;'">
  41. <!-- #endif -->
  42. <!-- #ifndef MP -->
  43. <view class='nav acea-row row-middle row-around'>
  44. <!-- #endif -->
  45. <view class='item line1' :class='title ? "font-num":""' @click='set_where(1)'>{{title ? title:'默认'}}
  46. </view>
  47. <view class='item' @click='set_where(2)'>
  48. 价格
  49. <image v-if="price==1" src='../../../static/images/up.png'></image>
  50. <image v-else-if="price==2" src='../../../static/images/down.png'></image>
  51. <image v-else src='../../../static/images/horn.png'></image>
  52. </view>
  53. <view class='item' @click='set_where(3)'>
  54. 销量
  55. <image v-if="stock==1" src='../../../static/images/up.png'></image>
  56. <image v-else-if="stock==2" src='../../../static/images/down.png'></image>
  57. <image v-else src='../../../static/images/horn.png'></image>
  58. </view>
  59. <!-- down -->
  60. <!-- <view class='item' :class='nows ? "font-color":""' @click='set_where(4)'>新品</view> -->
  61. <view class='item' v-if="brandList.length" :class="{clored:brandArray.length>0}" @click='set_brand'>品牌
  62. <image src='../static/xiala.png'></image>
  63. </view>
  64. <homeList :navH="navH" :goodList="goodList" :currentPage="currentPage" :sysHeight="sysHeight"
  65. :goodsShow="true"></homeList>
  66. </view>
  67. <!-- #ifdef MP -->
  68. <view class='list acea-row row-between-wrapper' :style="'margin-top:'+(menuButton.top+menuButton.height+92)+'px;'" :class='is_switch==true?"":"on"' v-if="is_switch==false">
  69. <!-- #endif -->
  70. <!-- #ifndef MP -->
  71. <view class='list acea-row row-between-wrapper' :class='is_switch==true?"":"on"' v-if="is_switch==false">
  72. <!-- #endif -->
  73. <view class="title" v-if="promotionsInfo.title"><text class="label">{{promotionsInfo.title}}</text>{{promotionsInfo.desc}}</view>
  74. <view class='item' :class='is_switch==true?"":"on"' hover-class='none'
  75. v-for="(item,index) in productList" :key="index" @click="godDetail(item)">
  76. <view class='pictrue' :class='is_switch==true?"":"on"'>
  77. <image :src='item.image' :class='is_switch==true?"":"on"'></image>
  78. <view class="activityFrame" v-if="item.activity_frame.image" :style="'background-image: url('+item.activity_frame.image+');'"></view>
  79. <view class="masks acea-row row-center-wrapper" v-if="item.stock<=0">
  80. <view class="bg">
  81. <view>暂时</view>
  82. <view>售罄</view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class='text' :class='is_switch==true?"":"on"'>
  87. <view class="nameCon">
  88. <view class='name line2'>{{item.store_name}}</view>
  89. <text class="label"
  90. v-if="item.activity && item.activity.type === '1' && !promotions_type">秒杀</text>
  91. <text class="label"
  92. v-if="item.activity && item.activity.type === '2' && !promotions_type">砍价</text>
  93. <text class="label"
  94. v-if="item.activity && item.activity.type === '3' && !promotions_type">拼团</text>
  95. <text class="label" v-if="item.promotions.title">{{item.promotions.title}}</text>
  96. </view>
  97. <view class="vip acea-row row-middle on">
  98. <view class='money font-color' :class='is_switch==true?"":"on"'>¥<text
  99. class='num'>{{item.price}}</text></view>
  100. <view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">
  101. <view>¥{{item.vip_price}}</view>
  102. <view class="icon on" v-if="item.price_type && item.price_type == 'member'"><text
  103. class="iconfont icon-huangguan4"></text>SVIP</view>
  104. <view class="icon" v-if="item.price_type && item.price_type == 'level'"><text
  105. class="iconfont icon-dengjitubiao"></text>{{item.level_name}}</view>
  106. </view>
  107. </view>
  108. <view class='sales acea-row row-between-wrapper'>
  109. <view class="acea-row">
  110. <view>已售{{item.sales}}{{item.unit_name || '件'}}</view>
  111. <view class="score">评分 {{item.star}}</view>
  112. </view>
  113. <view v-if="promotions_type && item.product_type==0 && !item.custom_form.length"
  114. class="icon acea-row row-center-wrapper" @click.stop="joinCart(item)">
  115. <text class="iconfont icon-gouwuche"></text>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. <view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
  121. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  122. </view>
  123. <view class="height-add" v-if="productList.length>3"></view>
  124. <view class="footer acea-row row-between-wrapper" v-if="promotions_type">
  125. <view class="acea-row row-middle">
  126. <view class="icon">
  127. <text class="iconfont icon-pinzhongqiquan"></text>
  128. <view class="num acea-row row-center-wrapper" v-if="totalNum>0">{{totalNum}}</view>
  129. </view>
  130. <view class="right">
  131. <view class="num">小计:<text class="money">¥{{totalPrice || 0}}</text></view>
  132. <view v-if="this.promotions_type != 4">
  133. <view v-if="promotionsInfo.differ_threshold>0">
  134. 再买{{promotionsInfo.differ_threshold}}{{promotionsInfo.threshold_type==1?'元':'件'}}<text
  135. v-if="promotionsInfo.differ_price || promotionsInfo.differ_discount">,
  136. <text v-if="promotionsInfo.differ_price">可减{{promotionsInfo.differ_price}}元</text>
  137. <text v-else>可打{{parseFloat(promotionsInfo.differ_discount)/10}}折</text>
  138. </text>
  139. </view>
  140. <view v-else>
  141. <text v-if="promotionsInfo.reach_threshold">已购满{{promotionsInfo.reach_threshold}}{{promotionsInfo.threshold_type==1?'元':'件'}},</text>已减{{promotionsInfo.sum_promotions_price}}元
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="bnt" @click="goCart">去购物车</view>
  147. </view>
  148. </view>
  149. <!-- #ifdef MP -->
  150. <view class="list waterList" :style="'margin-top:'+(menuButton.top+menuButton.height+102)+'px;'" v-else>
  151. <!-- #endif -->
  152. <!-- #ifndef MP -->
  153. <view class="list waterList" v-else>
  154. <!-- #endif -->
  155. <waterfallsFlow ref="waterfallsFlow" :list="productList" @wapper-lick="godDetail">
  156. <!-- #ifdef MP-WEIXIN -->
  157. <view v-for="(item, index) of productList" :key="index" slot="slot{{index}}">
  158. <view class="waterfalls">
  159. <view class='name line2'>{{item.store_name}}</view>
  160. <span class="label"
  161. v-if="item.activity && item.activity.type === '1' && !promotions_type">秒杀</span>
  162. <span class="label"
  163. v-if="item.activity && item.activity.type === '2' && !promotions_type">砍价</span>
  164. <span class="label"
  165. v-if="item.activity && item.activity.type === '3' && !promotions_type">拼团</span>
  166. <text class="label" v-if="item.promotions.title">{{item.promotions.title}}</text>
  167. <view class="vip acea-row row-middle">
  168. <view class='money font-color'>
  169. ¥<text class='num'>{{item.price.toString().split(".")[0]}}</text>
  170. <text class='nums'
  171. v-if="item.price.toString().split('.').length>1">.{{item.price.toString().split(".")[1]}}</text>
  172. </view>
  173. <view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">
  174. <view>¥{{item.vip_price}}</view>
  175. <!-- <image src='../../static/images/vip.png' v-if="item.price_type == 'member'"></image> -->
  176. <view class="icon on" v-if="item.price_type && item.price_type == 'member'"><text
  177. class="iconfont icon-huangguan4"></text>SVIP</view>
  178. <view class="icon" v-if="item.price_type && item.price_type == 'level'"><text
  179. class="iconfont icon-dengjitubiao"></text>{{item.level_name}}</view>
  180. </view>
  181. </view>
  182. <view class='vip acea-row row-between-wrapper'>
  183. <view>已售{{item.sales}}{{item.unit_name || '件'}}</view>
  184. <view>评分 {{item.star}}</view>
  185. </view>
  186. </view>
  187. </view>
  188. <!-- #endif -->
  189. <!-- #ifndef MP-WEIXIN -->
  190. <template v-slot:default="item">
  191. <view class="waterfalls">
  192. <view class='name line2'>{{item.store_name}}</view>
  193. <span class="label"
  194. v-if="item.activity && item.activity.type === '1' && !promotions_type">秒杀</span>
  195. <span class="label"
  196. v-if="item.activity && item.activity.type === '2' && !promotions_type">砍价</span>
  197. <span class="label"
  198. v-if="item.activity && item.activity.type === '3' && !promotions_type">拼团</span>
  199. <text class="label" v-if="item.promotions.title">{{item.promotions.title}}</text>
  200. <view class="vip acea-row row-middle">
  201. <view class='money font-color'>
  202. ¥<text class='num'>{{item.price.toString().split(".")[0]}}</text>
  203. <text class='nums'
  204. v-if="item.price.toString().split('.').length>1">.{{item.price.toString().split(".")[1]}}</text>
  205. </view>
  206. <view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">
  207. <view>¥{{item.vip_price}}</view>
  208. <view class="icon on" v-if="item.price_type && item.price_type == 'member'"><text
  209. class="iconfont icon-huangguan4"></text>SVIP</view>
  210. <view class="icon" v-if="item.price_type && item.price_type == 'level'"><text
  211. class="iconfont icon-v"></text>{{item.level_name}}</view>
  212. </view>
  213. </view>
  214. <view class='vip acea-row row-between-wrapper'>
  215. <view>已售{{item.sales}}{{item.unit_name || '件'}}</view>
  216. <view>评分 {{item.star}}</view>
  217. </view>
  218. </view>
  219. </template>
  220. <!-- #endif -->
  221. </waterfallsFlow>
  222. <view class='loadingicon acea-row row-center-wrapper' v-if='productList.length > 0'>
  223. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  224. </view>
  225. </view>
  226. </view>
  227. <view class='noCommodity' v-if="productList.length==0 && where.page > 1">
  228. <view class='emptyBox'>
  229. <image :src="imgHost + '/statics/images/no-thing.png'"></image>
  230. <view class="tips">暂无商品,去看点别的吧</view>
  231. </view>
  232. <recommend :hostProduct="hostProduct"></recommend>
  233. </view>
  234. <productWindow :attr="attr" :isShow='1' :iSplus='1' :iScart='1' :storeInfo='storeInfo' @myevent="onMyEvent"
  235. @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum"
  236. @goCat="goCat" id='product-window' :is_vip="is_vip"></productWindow>
  237. <home v-if="navigation"></home>
  238. <view class="mask" @touchmove.prevent :hidden="brandtip === false" @click="closeBrand"></view>
  239. <!-- #ifdef MP -->
  240. <view class="selectbrand" :style="'top:'+(menuButton.top+menuButton.height+92)+'px;'" :class="brandtip === true ? 'on' : ''">
  241. <!-- #endif -->
  242. <!-- #ifndef MP -->
  243. <view class="selectbrand" :class="brandtip === true ? 'on' : ''">
  244. <!-- #endif -->
  245. <view class="box">
  246. <view class="selet">
  247. <view class="seletbox acea-row row-center-wrapper"
  248. :class="{seleton:brandArray.indexOf(item.id) != -1}" v-for="(item,index) in brandList"
  249. :key="index" @click="seletBrand(item.id)">{{item.brand_name}}</view>
  250. </view>
  251. <view class="btn">
  252. <div class="sambox reset" @click="brandReset">重置</div>
  253. <div class="sambox ok" @click="brandOk">确定</div>
  254. </view>
  255. </view>
  256. </view>
  257. <!-- #ifdef MP -->
  258. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  259. <!-- #endif -->
  260. </view>
  261. </template>
  262. <script>
  263. let sysHeight = uni.getSystemInfoSync().statusBarHeight;
  264. // #ifdef MP
  265. let menuButton = uni.getMenuButtonBoundingClientRect();
  266. // #endif
  267. import home from '@/components/home';
  268. import homeList from '@/components/homeList'
  269. import productWindow from '@/components/productWindow';
  270. import waterfallsFlow from "@/components/maramlee-waterfalls-flow/maramlee-waterfalls-flow.vue";
  271. import {
  272. getProductslist,
  273. getProductHot,
  274. brand,
  275. getAttr,
  276. postCartAdd
  277. } from '@/api/store.js';
  278. import {
  279. toLogin
  280. } from '@/libs/login.js';
  281. import recommend from '@/components/recommend';
  282. import {
  283. mapGetters
  284. } from "vuex";
  285. import {
  286. goShopDetail
  287. } from '@/libs/order.js';
  288. import {
  289. getCartList,
  290. getCartCounts
  291. } from '@/api/order.js';
  292. import colors from '@/mixins/color.js';
  293. import {HTTP_REQUEST_URL} from '@/config/app';
  294. export default {
  295. computed: mapGetters(['uid', 'isLogin']),
  296. components: {
  297. recommend,
  298. home,
  299. homeList,
  300. waterfallsFlow,
  301. productWindow
  302. },
  303. mixins: [colors],
  304. data() {
  305. return {
  306. // #ifdef MP
  307. menuButton:menuButton,
  308. // #endif
  309. id: 0,
  310. productValue: [], //系统属性
  311. is_vip: 0, //是否是会员
  312. attr: {
  313. cartAttr: false,
  314. productAttr: [],
  315. productSelect: {}
  316. },
  317. attrValue: '', //已选属性
  318. navH: 22,
  319. sysHeight: sysHeight,
  320. sysHeight: 0,
  321. goodList: true,
  322. currentPage: false,
  323. brandtip: false, //品牌弹窗
  324. brandArray: [],
  325. productList: [],
  326. is_switch: true,
  327. where: {
  328. sid: 0,
  329. keyword: '',
  330. priceOrder: '',
  331. salesOrder: '',
  332. award:0,
  333. news: 0,
  334. page: 1,
  335. limit: 20,
  336. cid: 0,
  337. brand_id: [],
  338. promotions_id: 0
  339. },
  340. price: 0,
  341. stock: 0,
  342. nows: false,
  343. loadend: false,
  344. loading: false,
  345. loadTitle: '加载更多',
  346. title: '',
  347. hostProduct: [],
  348. hotPage: 1,
  349. hotLimit: 10,
  350. hotScroll: false,
  351. brandList: [],
  352. storeInfo: {},
  353. promotions_type: 0,
  354. totalPrice: 0,
  355. promotionsInfo: {},
  356. totalNum: 0,
  357. imgHost:HTTP_REQUEST_URL,
  358. isShowAuth: false
  359. };
  360. },
  361. onLoad: function(options) {
  362. this.where.cid = options.cid || 0;
  363. if(options.award){
  364. this.where.award = options.award;
  365. }
  366. this.$set(this.where, 'sid', options.sid || 0);
  367. this.title = options.title || '';
  368. this.$set(this.where, 'keyword', options.searchValue ? decodeURIComponent(options.searchValue) : '');
  369. this.$set(this.where, 'productId', options.productId || '');
  370. this.$set(this.where, 'brand_id', options.brandId || 0);
  371. if (options.promotions_type) {
  372. this.promotions_type = options.promotions_type;
  373. this.where.promotions_id = options.promotions_id;
  374. if (options.promotions_type) {
  375. this.is_switch = false
  376. }
  377. }
  378. this.get_product_list();
  379. this.getBrand();
  380. },
  381. onShow() {
  382. uni.removeStorageSync('form_type_cart');
  383. if (this.isLogin && !this.is_switch) {
  384. this.getCartList();
  385. this.getCartNum();
  386. }
  387. },
  388. methods: {
  389. returnPage(){
  390. uni.navigateBack({
  391. delta:1 //返回层数,2则上上页
  392. })
  393. },
  394. getIsLogin(){
  395. toLogin()
  396. },
  397. onLoadFun(){
  398. if (!this.is_switch) {
  399. this.getCartList();
  400. this.getCartNum();
  401. }
  402. this.isShowAuth = false
  403. },
  404. // 授权关闭
  405. authColse: function(e) {
  406. this.isShowAuth = e
  407. },
  408. getCartNum() {
  409. let id = uni.getStorageSync('user_store_id') || 0;
  410. getCartCounts(0,id).then(res => {
  411. this.totalNum = res.data.count;
  412. }).catch(err => {
  413. return this.$util.Tips({
  414. title: err
  415. });
  416. })
  417. },
  418. getCartList() {
  419. let truePrice = 0;
  420. getCartList().then(res => {
  421. let data = res.data,
  422. valid = res.data.valid;
  423. valid.forEach(item => {
  424. item.promotions.forEach(z => {
  425. if (this.where.promotions_id == z.id) {
  426. this.promotionsInfo = z;
  427. }
  428. })
  429. item.cart.forEach(j => {
  430. truePrice = this.$util.$h.Add(truePrice, this.$util.$h.Mul(j.truePrice, j.cart_num));
  431. })
  432. })
  433. this.totalPrice = this.$util.$h.Sub(truePrice, data.deduction.coupon_price)
  434. }).catch(err => {
  435. return this.$util.Tips({
  436. title: err
  437. });
  438. })
  439. },
  440. goCart() {
  441. uni.switchTab({
  442. url: '/pages/order_addcart/order_addcart'
  443. })
  444. },
  445. /*
  446. * 加入购物车
  447. */
  448. goCat: function(news) {
  449. let that = this,
  450. productSelect = that.productValue[this.attrValue];
  451. //如果有属性,没有选择,提示用户选择
  452. if (that.attr.productAttr.length && productSelect === undefined)
  453. return that.$util.Tips({
  454. title: '产品库存不足,请选择其它属性'
  455. });
  456. if (that.attr.productSelect.cart_num <= 0) {
  457. that.attr.productSelect.cart_num = 1
  458. return that.$util.Tips({
  459. title: '请先选择属性'
  460. });
  461. }
  462. let q = {
  463. productId: that.id,
  464. cartNum: that.attr.productSelect.cart_num,
  465. new: 0,
  466. uniqueId: that.attr.productSelect !== undefined ? that.attr.productSelect.unique : ''
  467. };
  468. postCartAdd(q)
  469. .then(function(res) {
  470. that.isOpen = false;
  471. that.attr.cartAttr = false;
  472. if (news) {
  473. uni.navigateTo({
  474. url: '/pages/goods/order_confirm/index?new=1&cartId=' + res.data.cartId
  475. });
  476. } else {
  477. that.$util.Tips({
  478. title: '添加购物车成功'
  479. });
  480. }
  481. that.getCartNum();
  482. that.getCartList();
  483. })
  484. .catch(err => {
  485. that.isOpen = false;
  486. return that.$util.Tips({
  487. title: err
  488. });
  489. });
  490. },
  491. /**
  492. * 打开属性加入购物车
  493. *
  494. */
  495. joinCart: function(item) {
  496. //是否登录
  497. if (this.isLogin === false) {
  498. this.getIsLogin();
  499. } else {
  500. uni.showLoading({
  501. title: '加载中'
  502. });
  503. this.getAttrs(item.id);
  504. this.$set(this, 'id', item.id);
  505. this.$set(this.attr, 'cartAttr', true);
  506. }
  507. },
  508. // 商品详情接口;
  509. getAttrs(id) {
  510. let that = this;
  511. getAttr(id, 0).then(res => {
  512. uni.hideLoading();
  513. that.$set(that.attr, 'productAttr', res.data.productAttr);
  514. that.$set(that, 'productValue', res.data.productValue);
  515. that.$set(that, 'is_vip', res.data.storeInfo.is_vip);
  516. that.$set(that, 'storeInfo', res.data.storeInfo);
  517. that.DefaultSelect();
  518. })
  519. },
  520. /**
  521. * 默认选中属性
  522. *
  523. */
  524. DefaultSelect: function() {
  525. let productAttr = this.attr.productAttr;
  526. let value = [];
  527. for (var key in this.productValue) {
  528. if (this.productValue[key].stock > 0) {
  529. value = this.attr.productAttr.length ? key.split(',') : [];
  530. break;
  531. }
  532. }
  533. for (let i = 0; i < productAttr.length; i++) {
  534. this.$set(productAttr[i], 'index', value[i]);
  535. }
  536. //sort();排序函数:数字-英文-汉字;
  537. let productSelect = this.productValue[value.join(',')];
  538. if (productSelect && productAttr.length) {
  539. this.$set(this.attr.productSelect, 'store_name', this.storeInfo.store_name);
  540. this.$set(this.attr.productSelect, 'image', productSelect.image);
  541. this.$set(this.attr.productSelect, 'price', productSelect.price);
  542. this.$set(this.attr.productSelect, 'stock', productSelect.stock);
  543. this.$set(this.attr.productSelect, 'unique', productSelect.unique);
  544. this.$set(this.attr.productSelect, 'cart_num', 1);
  545. this.$set(this, 'attrValue', value.join(','));
  546. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  547. } else if (!productSelect && productAttr.length) {
  548. this.$set(this.attr.productSelect, 'store_name', this.storeInfo.store_name);
  549. this.$set(this.attr.productSelect, 'image', this.storeInfo.image);
  550. this.$set(this.attr.productSelect, 'price', this.storeInfo.price);
  551. this.$set(this.attr.productSelect, 'stock', 0);
  552. this.$set(this.attr.productSelect, 'unique', '');
  553. this.$set(this.attr.productSelect, 'cart_num', 0);
  554. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  555. this.$set(this, 'attrValue', '');
  556. } else if (!productSelect && !productAttr.length) {
  557. this.$set(this.attr.productSelect, 'store_name', this.storeInfo.store_name);
  558. this.$set(this.attr.productSelect, 'image', this.storeInfo.image);
  559. this.$set(this.attr.productSelect, 'price', this.storeInfo.price);
  560. this.$set(this.attr.productSelect, 'stock', this.storeInfo.stock);
  561. this.$set(this.attr.productSelect, 'unique', this.storeInfo.unique || '');
  562. this.$set(this.attr.productSelect, 'cart_num', 1);
  563. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  564. this.$set(this, 'attrValue', '');
  565. }
  566. },
  567. /**
  568. * 购物车手动填写
  569. *
  570. */
  571. iptCartNum: function(e) {
  572. this.$set(this.attr.productSelect, 'cart_num', e);
  573. },
  574. attrVal(val) {
  575. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val
  576. .indexn]);
  577. },
  578. onMyEvent: function() {
  579. this.$set(this.attr, 'cartAttr', false);
  580. },
  581. /**
  582. * 属性变动赋值
  583. *
  584. */
  585. ChangeAttr: function(res) {
  586. let productSelect = this.productValue[res];
  587. if (productSelect && productSelect.stock > 0) {
  588. this.$set(this.attr.productSelect, "image", productSelect.image);
  589. this.$set(this.attr.productSelect, "price", productSelect.price);
  590. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  591. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  592. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  593. this.$set(this.attr.productSelect, "cart_num", 1);
  594. this.$set(this, "attrValue", res);
  595. } else if (productSelect && productSelect.stock == 0) {
  596. this.$set(this.attr.productSelect, "image", productSelect.image);
  597. this.$set(this.attr.productSelect, "price", productSelect.price);
  598. this.$set(this.attr.productSelect, "stock", 0);
  599. this.$set(this.attr.productSelect, "unique", "");
  600. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  601. this.$set(this.attr.productSelect, "cart_num", 0);
  602. this.$set(this, "attrValue", "");
  603. } else {
  604. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  605. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  606. this.$set(this.attr.productSelect, "stock", 0);
  607. this.$set(this.attr.productSelect, "unique", "");
  608. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  609. this.$set(this.attr.productSelect, "cart_num", 0);
  610. this.$set(this, "attrValue", "");
  611. }
  612. },
  613. /**
  614. * 购物车数量加和数量减
  615. *
  616. */
  617. ChangeCartNum: function(changeValue) {
  618. //changeValue:是否 加|减
  619. //获取当前变动属性
  620. let productSelect = this.productValue[this.attrValue];
  621. //如果没有属性,赋值给商品默认库存
  622. if (productSelect === undefined && !this.attr.productAttr.length) productSelect = this.attr
  623. .productSelect;
  624. //无属性值即库存为0;不存在加减;
  625. if (productSelect === undefined) return;
  626. let stock = productSelect.stock || 0;
  627. let num = this.attr.productSelect;
  628. if (changeValue) {
  629. num.cart_num++;
  630. if (num.cart_num > stock) {
  631. this.$set(this.attr.productSelect, 'cart_num', stock ? stock : 1);
  632. this.$set(this, 'cart_num', stock ? stock : 1);
  633. }
  634. } else {
  635. num.cart_num--;
  636. if (num.cart_num < 1) {
  637. this.$set(this.attr.productSelect, 'cart_num', 1);
  638. this.$set(this, 'cart_num', 1);
  639. }
  640. }
  641. },
  642. moreNav() {
  643. this.currentPage = !this.currentPage
  644. },
  645. // 品牌列表
  646. getBrand() {
  647. brand(this.where).then(res => {
  648. this.brandList = res.data
  649. }).catch(err => {
  650. return this.$util.Tips({
  651. title: err.msg
  652. });
  653. })
  654. },
  655. //打开品牌弹窗
  656. set_brand() {
  657. this.brandtip = true
  658. this.currentPage = false
  659. },
  660. //关闭品牌/新品弹窗
  661. closeBrand() {
  662. this.brandtip = false
  663. },
  664. // 品牌选择
  665. seletBrand(id) {
  666. if (this.brandArray.indexOf(id) == -1) {
  667. this.brandArray.push(id)
  668. } else {
  669. this.brandArray.splice(this.brandArray.indexOf(id), 1)
  670. }
  671. },
  672. brandReset() {
  673. this.brandArray = []
  674. this.brandOk();
  675. },
  676. brandOk() {
  677. this.brandtip = false;
  678. this.loadend = false;
  679. this.$set(this.where, 'page', 1);
  680. this.get_product_list(true);
  681. },
  682. // 去详情页
  683. godDetail(item) {
  684. this.currentPage = false
  685. if (this.promotions_type) {
  686. uni.navigateTo({
  687. url: `/pages/goods_details/index?id=${item.id}`
  688. })
  689. } else {
  690. goShopDetail(item, this.uid).then(res => {
  691. uni.navigateTo({
  692. url: `/pages/goods_details/index?id=${item.id}`
  693. })
  694. })
  695. }
  696. },
  697. Changswitch: function() {
  698. let that = this;
  699. this.currentPage = false
  700. that.is_switch = !that.is_switch
  701. },
  702. searchSubmit: function(e) {
  703. let that = this;
  704. this.currentPage = false
  705. that.$set(that.where, 'keyword', e.detail.value);
  706. that.loadend = false;
  707. that.$set(that.where, 'page', 1)
  708. this.get_product_list(true);
  709. },
  710. /**
  711. * 获取我的推荐
  712. */
  713. get_host_product: function() {
  714. let that = this;
  715. if (that.hotScroll) return
  716. getProductHot(
  717. that.hotPage,
  718. that.hotLimit,
  719. ).then(res => {
  720. that.hotPage++
  721. that.hotScroll = res.data.length < that.hotLimit
  722. that.hostProduct = that.hostProduct.concat(res.data)
  723. // that.$set(that, 'hostProduct', res.data)
  724. });
  725. },
  726. //点击事件处理
  727. set_where: function(e) {
  728. this.currentPage = false
  729. switch (e) {
  730. case 1:
  731. // #ifdef H5
  732. return history.back();
  733. // #endif
  734. // #ifndef H5
  735. return uni.navigateBack({
  736. delta: 1,
  737. })
  738. // #endif
  739. break;
  740. case 2:
  741. if (this.price == 0) this.price = 1;
  742. else if (this.price == 1) this.price = 2;
  743. else if (this.price == 2) this.price = 0;
  744. this.stock = 0;
  745. break;
  746. case 3:
  747. if (this.stock == 0) this.stock = 1;
  748. else if (this.stock == 1) this.stock = 2;
  749. else if (this.stock == 2) this.stock = 0;
  750. this.price = 0
  751. break;
  752. case 4:
  753. this.nows = !this.nows;
  754. break;
  755. }
  756. this.loadend = false;
  757. this.$set(this.where, 'page', 1);
  758. this.get_product_list(true);
  759. },
  760. //设置where条件
  761. setWhere: function() {
  762. if (this.price == 0) this.where.priceOrder = '';
  763. else if (this.price == 1) this.where.priceOrder = 'asc';
  764. else if (this.price == 2) this.where.priceOrder = 'desc';
  765. if (this.stock == 0) this.where.salesOrder = '';
  766. else if (this.stock == 1) this.where.salesOrder = 'asc';
  767. else if (this.stock == 2) this.where.salesOrder = 'desc';
  768. this.where.news = this.nows ? 1 : 0;
  769. },
  770. //查找产品
  771. get_product_list: function(isPage) {
  772. let that = this;
  773. that.setWhere();
  774. if (that.loadend) return;
  775. if (that.loading) return;
  776. if (isPage === true) {
  777. if (this.is_switch) {
  778. that.$refs.waterfallsFlow.refresh();
  779. }
  780. that.$set(that, 'productList', []);
  781. }
  782. that.loading = true;
  783. that.loadTitle = '';
  784. that.$set(that.where, 'brand_id', that.brandArray.join(","));
  785. getProductslist(that.where).then(res => {
  786. let list = res.data;
  787. let productList = that.$util.SplitArray(list, that.productList);
  788. let loadend = list.length < that.where.limit;
  789. that.loadend = loadend;
  790. that.loading = false;
  791. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  792. that.$set(that, 'productList', productList);
  793. that.$set(that.where, 'page', that.where.page + 1);
  794. if (!that.productList.length) this.get_host_product();
  795. }).catch(err => {
  796. that.loading = false;
  797. that.loadTitle = '加载更多';
  798. });
  799. },
  800. },
  801. onPullDownRefresh() {
  802. },
  803. onPageScroll(e) {
  804. this.currentPage = false
  805. },
  806. onReachBottom() {
  807. if (this.productList.length > 0) {
  808. this.get_product_list();
  809. } else {
  810. this.get_host_product();
  811. }
  812. }
  813. }
  814. </script>
  815. <style scoped lang="scss">
  816. .productList{
  817. .header{
  818. position: fixed;
  819. top:0;
  820. left:0;
  821. width: 100%;
  822. z-index: 9;
  823. background-color: var(--view-theme);
  824. .bnt{
  825. background: rgba(0, 0, 0, 0.2);
  826. border-radius: 50rpx;
  827. border: 0.5px solid rgba(255, 255, 255, 0.3);
  828. position: fixed;
  829. left:10px;
  830. color: #fff;
  831. .iconfont{
  832. width: 48%;
  833. text-align: center;
  834. }
  835. .lines{
  836. width: 1rpx;
  837. height: 34rpx;
  838. background-color: rgba(225, 225, 225, 0.2);
  839. }
  840. }
  841. .title{
  842. font-size: 34rpx;
  843. color: #fff;
  844. }
  845. }
  846. }
  847. .height-add {
  848. height: 100rpx;
  849. height: calc(100rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  850. height: calc(100rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  851. width: 100%;
  852. }
  853. .home {
  854. color: #333;
  855. width: 56rpx;
  856. height: 56rpx;
  857. background: rgba(255, 255, 255, 1);
  858. border: 1px solid rgba(0, 0, 0, 0.1);
  859. border-radius: 40rpx;
  860. font-size: 33rpx;
  861. &.on {
  862. background: unset;
  863. color: #333;
  864. }
  865. &.homeIndex {
  866. width: 98rpx;
  867. }
  868. }
  869. .home .iconfont {
  870. width: 60rpx;
  871. text-align: center;
  872. font-size: 28rpx;
  873. font-weight: bold;
  874. }
  875. .home .line {
  876. width: 1rpx;
  877. height: 34rpx;
  878. background: #B3B3B3;
  879. }
  880. .home .icon-xiangzuo {
  881. font-size: 28rpx;
  882. }
  883. .clored {
  884. color: var(--view-theme);
  885. font-weight: 600;
  886. .icon-gou {
  887. font-weight: 400 !important;
  888. }
  889. }
  890. .selectbrand {
  891. position: fixed;
  892. background-color: #FFFFFF;
  893. z-index: 8;
  894. width: 100%;
  895. top: 170rpx;
  896. left: 0;
  897. max-height: 860rpx;
  898. overflow: hidden;
  899. overflow-y: auto;
  900. border-radius: 0 0 24rpx 24rpx;
  901. transform: translate3d(0, -100%, 0);
  902. transition: all .2s cubic-bezier(.9, .5, .5, .25);
  903. // padding-top: 200rpx;
  904. // padding-top: calc(200rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  905. // padding-top: calc(200rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  906. .box {
  907. .selet {
  908. display: flex;
  909. flex-wrap: wrap;
  910. padding: 20rpx 20rpx 0 20rpx;
  911. max-height: 520rpx;
  912. overflow-x: hidden;
  913. overflow-y: auto;
  914. .seletbox {
  915. width: 216rpx;
  916. height: 68rpx;
  917. border-radius: 34rpx;
  918. background-color: #F5F5F5;
  919. margin-bottom: 30rpx;
  920. text-align: center;
  921. font-size: 24rpx;
  922. margin-right: 28rpx;
  923. &:nth-child(3n) {
  924. margin-right: 0;
  925. }
  926. }
  927. .seleton {
  928. border: 1px solid var(--view-theme);
  929. background: var(--view-minorColorT);
  930. color: var(--view-theme);
  931. }
  932. }
  933. .btn {
  934. display: flex;
  935. justify-content: space-between;
  936. text-align: center;
  937. padding: 30rpx 20rpx 40rpx;
  938. .sambox {
  939. width: 328rpx;
  940. height: 64rpx;
  941. border-radius: 38rpx;
  942. border: 2rpx solid var(--view-theme);
  943. color: #FFFFFF;
  944. line-height: 64rpx;
  945. }
  946. .reset {
  947. color: var(--view-theme);
  948. }
  949. .ok {
  950. background: var(--view-theme);
  951. }
  952. }
  953. .tlebox {
  954. width: 100%;
  955. height: 88rpx;
  956. line-height: 88rpx;
  957. display: flex;
  958. justify-content: space-between;
  959. padding: 0 40rpx 0 36rpx;
  960. margin-left: 20rpx;
  961. border-bottom: 2rpx solid #EEEEEE;
  962. }
  963. .tlebox:last-child {
  964. border-bottom: 0;
  965. }
  966. }
  967. }
  968. .selectbrand.on {
  969. transform: translate3d(0, 0, 0);
  970. }
  971. .productList .searchMp{
  972. padding-left: 23rpx;
  973. padding-right: 5rpx;
  974. margin-top: 7px;
  975. }
  976. .productList .searchMp .icon-pailie,
  977. .productList .searchMp .icon-tupianpailie{
  978. color: #fff;
  979. width: 62rpx;
  980. font-size: 40rpx;
  981. height: 33px;
  982. line-height: 33px;
  983. }
  984. .productList .searchMp .input{
  985. width: 636rpx;
  986. height: 30px;
  987. background-color: #fff;
  988. border-radius: 30rpx;
  989. padding: 0 20rpx;
  990. box-sizing: border-box;
  991. &.on{
  992. width: 704rpx;
  993. input{
  994. width: 619rpx;
  995. }
  996. }
  997. input{
  998. width: 550rpx;
  999. height: 100%;
  1000. font-size: 26rpx;
  1001. }
  1002. .placeholder{
  1003. color: #ccc;
  1004. }
  1005. .iconfont{
  1006. color: #ccc;
  1007. font-size: 35rpx;
  1008. }
  1009. }
  1010. .productList .search {
  1011. width: 100%;
  1012. height: 86rpx;
  1013. padding-left: 23rpx;
  1014. box-sizing: border-box;
  1015. position: fixed;
  1016. left: 0;
  1017. top: 0;
  1018. z-index: 9;
  1019. .fanhui {
  1020. color: #fff;
  1021. }
  1022. }
  1023. .productList .search .input {
  1024. width: 638rpx;
  1025. height: 60rpx;
  1026. background-color: #fff;
  1027. border-radius: 50rpx;
  1028. padding: 0 20rpx;
  1029. box-sizing: border-box;
  1030. &.on {
  1031. width: 652rpx;
  1032. margin-right: 30rpx;
  1033. input {
  1034. width: 560rpx;
  1035. }
  1036. }
  1037. }
  1038. .productList .search .input input {
  1039. width: 546rpx;
  1040. height: 100%;
  1041. font-size: 26rpx;
  1042. }
  1043. .productList .search .input .placeholder {
  1044. color: #999;
  1045. }
  1046. .productList .search .input .iconfont {
  1047. font-size: 35rpx;
  1048. color: #555;
  1049. }
  1050. .productList .search .icon-pailie,
  1051. .productList .search .icon-tupianpailie {
  1052. color: #fff;
  1053. width: 62rpx;
  1054. font-size: 40rpx;
  1055. height: 86rpx;
  1056. line-height: 86rpx;
  1057. }
  1058. .productList .nav {
  1059. /* #ifdef H5 */
  1060. height: 86rpx;
  1061. /* #endif */
  1062. /* #ifndef H5 */
  1063. height: 45px;
  1064. /* #endif */
  1065. color: #454545;
  1066. position: fixed;
  1067. left: 0;
  1068. width: 100%;
  1069. font-size: 28rpx;
  1070. background-color: #fff;
  1071. margin-top: 86rpx;
  1072. top: 0;
  1073. z-index: 9;
  1074. }
  1075. .productList .nav .item {
  1076. width: 25%;
  1077. text-align: center;
  1078. }
  1079. .productList .nav .item.font-color {
  1080. font-weight: bold;
  1081. }
  1082. .productList .nav .item image {
  1083. width: 15rpx;
  1084. height: 19rpx;
  1085. margin-left: 10rpx;
  1086. }
  1087. .productList .list {
  1088. padding: 0 20rpx;
  1089. margin-top: 172rpx;
  1090. }
  1091. .productList .list.waterList {
  1092. margin-top: 192rpx;
  1093. }
  1094. .productList .list.on {
  1095. background-color: #fff;
  1096. border-top: 1px solid #f6f6f6;
  1097. .title {
  1098. font-size: 22rpx;
  1099. color: #333333;
  1100. margin-top: 30rpx;
  1101. .label {
  1102. border-radius: 4rpx;
  1103. padding: 2rpx 8rpx;
  1104. background-color: var(--view-minorColorT);
  1105. font-size: 20rpx;
  1106. color: var(--view-theme);
  1107. margin-right: 8rpx;
  1108. }
  1109. }
  1110. .footer {
  1111. width: 100%;
  1112. height: 96rpx;
  1113. background-color: #fff;
  1114. position: fixed;
  1115. bottom: 0;
  1116. left: 0;
  1117. box-shadow: 0 -4rpx 32rpx 0 rgba(0, 0, 0, 0.08);
  1118. padding: 0 20rpx 0 32rpx;
  1119. z-index: 9;
  1120. box-sizing: border-box;
  1121. padding-bottom: calc(constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/;
  1122. padding-bottom: calc(env(safe-area-inset-bottom)); ///兼容 IOS<11.2/;
  1123. height: calc(96rpx + constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1124. height: calc(96rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1125. .right {
  1126. color: #888888;
  1127. font-size: 20rpx;
  1128. margin-left: 32rpx;
  1129. .num {
  1130. font-size: 28rpx;
  1131. color: #333333;
  1132. font-weight: 400;
  1133. .money {
  1134. font-weight: 500;
  1135. }
  1136. }
  1137. }
  1138. .icon {
  1139. width: 72rpx;
  1140. height: 72rpx;
  1141. background: #F5F5F5;
  1142. border-radius: 50%;
  1143. text-align: center;
  1144. line-height: 72rpx;
  1145. position: relative;
  1146. .iconfont {
  1147. font-size: 38rpx;
  1148. }
  1149. .num {
  1150. min-width: 32rpx;
  1151. background-color: #fff;
  1152. color: var(--view-theme);
  1153. border-radius: 15px;
  1154. position: absolute;
  1155. right: -14rpx;
  1156. top: 0;
  1157. font-size: 10px;
  1158. padding: 0 8rpx;
  1159. height: 34rpx;
  1160. line-height: 31rpx;
  1161. border: 1px solid var(--view-theme);
  1162. }
  1163. }
  1164. .bnt {
  1165. width: 192rpx;
  1166. height: 64rpx;
  1167. background: var(--view-theme);
  1168. border-radius: 40rpx;
  1169. color: #FFFFFF;
  1170. font-size: 28rpx;
  1171. text-align: center;
  1172. line-height: 64rpx;
  1173. }
  1174. }
  1175. }
  1176. .productList .list .item {
  1177. width: 345rpx;
  1178. margin-top: 20rpx;
  1179. background-color: #fff;
  1180. border-radius: 20rpx;
  1181. .text {
  1182. &.on {
  1183. .nameCon {
  1184. height: 136rpx;
  1185. }
  1186. .name {
  1187. margin-bottom: 4rpx;
  1188. }
  1189. .label {
  1190. font-size: 20rpx;
  1191. color: var(--view-theme);
  1192. border-radius: 4rpx;
  1193. border: 1px solid var(--view-theme);
  1194. /* #ifdef APP */
  1195. padding: 2rpx 6rpx 0rpx 6rpx;
  1196. /* #endif */
  1197. /* #ifndef APP */
  1198. padding: 0 6rpx;
  1199. /* #endif */
  1200. margin-right: 10rpx;
  1201. }
  1202. .sales {
  1203. color: #999999;
  1204. font-size: 22rpx;
  1205. margin-top: 10rpx;
  1206. .score {
  1207. margin-left: 24rpx;
  1208. }
  1209. .icon {
  1210. width: 48rpx;
  1211. height: 48rpx;
  1212. border-radius: 50%;
  1213. border: 1px solid var(--view-theme);
  1214. font-size: 20rpx;
  1215. color: var(--view-theme);
  1216. }
  1217. }
  1218. }
  1219. }
  1220. }
  1221. .productList .list .item.on {
  1222. width: 100%;
  1223. display: flex;
  1224. margin: 30rpx 0 0 0;
  1225. }
  1226. .productList .list .item .pictrue {
  1227. position: relative;
  1228. width: 100%;
  1229. height: 345rpx;
  1230. }
  1231. .productList .list .item .pictrue.on {
  1232. width: 240rpx;
  1233. height: 240rpx;
  1234. position: relative;
  1235. .activityFrame{
  1236. border-radius: 12rpx;
  1237. }
  1238. .masks {
  1239. position: absolute;
  1240. top: 0;
  1241. left: 0;
  1242. right: 0;
  1243. bottom: 0;
  1244. background: rgba(0, 0, 0, 0.2);
  1245. border-radius: 10rpx;
  1246. .bg {
  1247. width: 110rpx;
  1248. height: 110rpx;
  1249. background: #000000;
  1250. opacity: 0.6;
  1251. color: #fff;
  1252. font-size: 22rpx;
  1253. border-radius: 50%;
  1254. padding: 22rpx 0;
  1255. text-align: center;
  1256. }
  1257. }
  1258. }
  1259. .productList .list .item .pictrue image {
  1260. width: 100%;
  1261. height: 100%;
  1262. border-radius: 20rpx 20rpx 0 0;
  1263. }
  1264. .productList .list .item .pictrue image.on {
  1265. border-radius: 12rpx;
  1266. }
  1267. .productList .list .item .text {
  1268. padding: 20rpx 17rpx 26rpx 17rpx;
  1269. font-size: 30rpx;
  1270. color: #222;
  1271. }
  1272. .productList .list .item .text.on {
  1273. width: 460rpx;
  1274. padding: 0 0 0 22rpx;
  1275. }
  1276. .productList .list .item .text .money {
  1277. font-size: 26rpx;
  1278. font-weight: bold;
  1279. margin-top: 8rpx;
  1280. }
  1281. .productList .list .item .text .money.on {
  1282. margin-top: 0;
  1283. margin-right: 5rpx;
  1284. }
  1285. .productList .list .item .text .money .num {
  1286. font-size: 34rpx;
  1287. }
  1288. .productList .list .item .text .vip {
  1289. font-size: 22rpx;
  1290. color: #aaa;
  1291. margin-top: 7rpx;
  1292. }
  1293. .productList .list .item .text .vip.on {
  1294. margin-top: 12rpx;
  1295. }
  1296. .productList .list .item .text .vip .vip-money {
  1297. font-size: 24rpx;
  1298. color: #282828;
  1299. font-weight: 600;
  1300. }
  1301. .productList .list .vip .vip-money .icon {
  1302. font-size: 15rpx;
  1303. background: #FF9500;
  1304. color: #fff;
  1305. border-radius: 18rpx;
  1306. padding: 1rpx 6rpx;
  1307. margin-left: 10rpx;
  1308. min-width: 60rpx;
  1309. .iconfont {
  1310. font-size: 15rpx;
  1311. margin-right: 5rpx;
  1312. }
  1313. &.on {
  1314. background: #333;
  1315. color: #FDDAA4;
  1316. min-width: unset;
  1317. }
  1318. }
  1319. .productList .list .item .text .vip .vip-money image {
  1320. width: 46rpx;
  1321. height: 21rpx;
  1322. margin-left: 4rpx;
  1323. }
  1324. .noCommodity {
  1325. background-color: #fff;
  1326. padding-bottom: 30rpx;
  1327. .emptyBox{
  1328. text-align: center;
  1329. .tips{
  1330. color: #aaa;
  1331. font-size: 26rpx;
  1332. }
  1333. image {
  1334. width: 414rpx;
  1335. height: 304rpx;
  1336. }
  1337. }
  1338. }
  1339. .waterfalls {
  1340. padding: 10rpx 16rpx 16rpx 16rpx;
  1341. color: #222;
  1342. .name {
  1343. font-size: 28rpx;
  1344. }
  1345. .label {
  1346. font-size: 20rpx;
  1347. color: var(--view-theme);
  1348. border-radius: 4rpx;
  1349. border: 1px solid var(--view-theme);
  1350. padding: 0 6rpx;
  1351. display: inline-block;
  1352. margin-top: 10rpx;
  1353. margin-right: 10rpx;
  1354. }
  1355. .money {
  1356. font-size: 26rpx;
  1357. font-weight: 700;
  1358. .num {
  1359. font-size: 34rpx;
  1360. }
  1361. .nums {
  1362. font-size: 28rpx;
  1363. }
  1364. }
  1365. .vip {
  1366. font-size: 22rpx;
  1367. color: #aaa;
  1368. margin-top: 6rpx;
  1369. .vip-money {
  1370. font-size: 24rpx;
  1371. color: #282828;
  1372. font-weight: bold;
  1373. image {
  1374. width: 46rpx;
  1375. height: 21rpx;
  1376. margin-left: 4rpx;
  1377. }
  1378. }
  1379. }
  1380. }
  1381. </style>