cart.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539
  1. <template>
  2. <!-- 商品分类第三种布局样式 -->
  3. <view class="goodCate">
  4. <!-- #ifdef MP || APP-PLUS -->
  5. <view class="mp-header">
  6. <view class="sys-head" :style="{ height: sysHeight }"></view>
  7. <view class="serch-box" style="height: 43px;">
  8. <view class="serch-wrapper acea-row row-middle">
  9. <navigator open-type="navigateBack" hover-class="none">
  10. <text class="iconfont icon-fanhui2"></text>
  11. </navigator>
  12. <navigator url="/pages/goods/goods_search/index" class="input acea-row row-center-wrapper" hover-class="none">
  13. <text class="iconfont icon-xiazai5"></text>
  14. 搜索商品信息
  15. </navigator>
  16. </view>
  17. </view>
  18. <!-- 门店地址详情 -->
  19. <view class="store-address">
  20. <view class="address acea-row row-middle">
  21. <view class="name line1">{{info.name || '暂无门店'}}</view>
  22. </view>
  23. <view class="distance">
  24. 门店距您{{info.range||0}}km
  25. </view>
  26. <view class="time">
  27. 营业时间:{{info.day_time || '-'}}
  28. </view>
  29. <view class="switch acea-row row-between-wrapper">
  30. <template v-for="(item, index) in deliveryList">
  31. <view v-if="item.key == switchNum" class="title on" :key="item.key" :class="{'onLeft':switchNum != 1}">{{item.name}}</view>
  32. </template>
  33. </view>
  34. </view>
  35. <!-- 门店详情 -->
  36. </view>
  37. <!-- #endif -->
  38. <!-- #ifdef H5 -->
  39. <view class="header acea-row row-center-wrapper">
  40. <navigator url="/pages/goods/goods_search/index" class="search acea-row row-middle" hover-class="none">
  41. <text class="iconfont icon-sousuo5"></text>
  42. 搜索商品信息
  43. </navigator>
  44. <view class="store-address">
  45. <view class="address acea-row row-middle">
  46. <view class="name line1">{{info.name || '暂无门店'}}</view>
  47. </view>
  48. <view class="distance">
  49. 门店距您{{info.range||0}}km
  50. </view>
  51. <view class="time">
  52. 营业时间:{{info.day_time || '-'}}
  53. </view>
  54. <view class="switch acea-row row-between-wrapper">
  55. <template v-for="(item, index) in deliveryList">
  56. <view :data-id="info.delivery_type" class="title on" :class="{'onLeft':switchNum != 1}" :key="item.key">{{item.name}}</view>
  57. </template>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="conter">
  62. <!-- #endif -->
  63. <!-- #ifndef H5 -->
  64. <view class="conter" :style="'padding-top:'+marTop+'px'">
  65. <!-- #endif -->
  66. <!-- #ifndef H5 -->
  67. <view class='aside' :style="'top:'+marTop+'px'">
  68. <!-- #endif -->
  69. <!-- #ifdef H5 -->
  70. <view class='aside'>
  71. <!-- #endif -->
  72. <view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""'
  73. v-for="(item,index) in categoryList" :key="index" @click="tapNav(index,item)">
  74. <text>{{item.cate_name}}</text>
  75. </view>
  76. </view>
  77. <view class="wrapper">
  78. <view class="bgcolor" v-if="iSlong">
  79. <!-- #ifndef H5 -->
  80. <view class="longTab acea-row row-middle" :style="'top:'+marTop+'px'">
  81. <!-- #endif -->
  82. <!-- #ifdef H5 -->
  83. <view class="longTab acea-row row-middle">
  84. <!-- #endif -->
  85. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex;height:44rpx;"
  86. scroll-with-animation :scroll-left="tabLeft" show-scrollbar="true">
  87. <view class="longItem" :style='"width:"+isWidth+"px"' :class="index===tabClick?'click':''"
  88. v-for="(item,index) in categoryErList" :key="index" @click="longClick(index)">
  89. {{item.cate_name}}
  90. </view>
  91. </scroll-view>
  92. </view>
  93. <!-- #ifndef H5 -->
  94. <view class="openList" :style="'top:'+marTop+'px'" @click="openTap"><text
  95. class="iconfont icon-xiangxia"></text></view>
  96. <!-- #endif -->
  97. <!-- #ifdef H5 -->
  98. <view class="openList" @click="openTap"><text class="iconfont icon-xiangxia"></text></view>
  99. <!-- #endif -->
  100. </view>
  101. <view v-else>
  102. <!-- #ifndef H5 -->
  103. <view class="downTab" :style="'margin-top:'+marTop+'px'">
  104. <!-- #endif -->
  105. <!-- #ifdef H5 -->
  106. <view class="downTab">
  107. <!-- #endif -->
  108. <view class="title acea-row row-between-wrapper">
  109. <view>{{categoryTitle}}</view>
  110. <view class="closeList" @click="closeTap"><text class="iconfont icon-xiangxia"></text>
  111. </view>
  112. </view>
  113. <view class="children">
  114. <view class="acea-row row-middle">
  115. <view class="item line1" :class="index===tabClick?'click':''"
  116. v-for="(item,index) in categoryErList" :key="index" @click="longClick(index)">
  117. {{item.cate_name}}
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. <view class="mask" @click="closeTap"></view>
  123. </view>
  124. <!--商品列表 -->
  125. <goodClass :tempArr="tempArr" :isLogin="isLogin" @gocartduo="goCartDuo" @gocartdan="goCartDan"
  126. @ChangeCartNumDan="ChangeCartNumDan" @detail="goDetail"></goodClass>
  127. <view class='loadingicon acea-row row-center-wrapper'>
  128. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  129. </view>
  130. </view>
  131. </view>
  132. <view class="footer acea-row row-between-wrapper" :class="isFooter?'':'on'">
  133. <view class="cartIcon acea-row row-center-wrapper" @click="getCartList(0)" v-if="cartNum>0">
  134. <!-- <view class="iconfont icon-gouwuche-yangshi2"></view>
  135. <text class="num">{{cartNum}}</text> -->
  136. <uni-badge class="uni-badge-left-margin" :text="cartNum" absolute="rightTop">
  137. <view class="iconfont icon-gouwuche-yangshi2"></view>
  138. </uni-badge>
  139. </view>
  140. <view class="cartIcon acea-row row-center-wrapper noCart" v-else>
  141. <view class="iconfont icon-gouwuche-yangshi2"></view>
  142. </view>
  143. <view class="acea-row row-middle" :class="cartNum>0?'':'noCart'">
  144. <view class="money">¥<text class="num">{{totalPrice}}</text></view>
  145. <view class="bnt" @click="subOrder">选好了</view>
  146. </view>
  147. </view>
  148. <!-- <addressWindow ref="addressWindow" :address="address" @changeClose="onAddress" @OnChangeAddress="onAddressChange"></addressWindow> -->
  149. <!-- 分类购物车下拉列表 -->
  150. <cartList :cartData="cartData" :isFooter='isFooter' @closeList="closeList" @ChangeCartNumDan="ChangeCartList"
  151. @ChangeSubDel="ChangeSubDel" @ChangeOneDel="ChangeOneDel"></cartList>
  152. <!-- 产品属性组件 -->
  153. <productWindow :attr="attr" :isShow='1' :iSplus='1' :iScart='1' @myevent="onMyEvent"
  154. @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNumDuo" @attrVal="attrVal" @iptCartNum="iptCartNum"
  155. @goCat="goCatNum" :is_vip="is_vip" id='product-window'></productWindow>
  156. <!-- #ifdef MP -->
  157. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  158. <!-- #endif -->
  159. </view>
  160. </template>
  161. <script>
  162. let sysHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  163. import {
  164. vcartList,
  165. getCartCounts,
  166. cartDel
  167. } from '@/api/order.js';
  168. import {
  169. getCategoryList,
  170. getAttr,
  171. postCartNum,
  172. getCollageCart,
  173. addCollageCart,
  174. getCollageCount,
  175. emptyCollagePartake,
  176. } from '@/api/store.js';
  177. import {
  178. getProducts,
  179. getCustomerList,
  180. getStoreCategory,
  181. getStoreBrand
  182. } from '@/api/new_store.js';
  183. import productWindow from '@/components/productWindow/index';
  184. import goodClass from '@/components/goodClass';
  185. import cartList from '@/components/cartList';
  186. // import addressWindow from '@/components/addressWindow';
  187. import {
  188. mapGetters
  189. } from 'vuex';
  190. import {
  191. goShopDetail
  192. } from '@/libs/order.js';
  193. import {
  194. toLogin
  195. } from '@/libs/login.js';
  196. export default {
  197. computed: {
  198. ...mapGetters(['isLogin', 'uid'])
  199. },
  200. components: {
  201. productWindow,
  202. goodClass,
  203. cartList,
  204. // addressWindow
  205. },
  206. props: {
  207. isFooter: {
  208. type: Boolean,
  209. default: false
  210. },
  211. info: {
  212. type: Object,
  213. default: {}
  214. },
  215. },
  216. data() {
  217. return {
  218. deliveryList:[
  219. {name:'自提',key:2},
  220. {name:'配送',key:1},
  221. ],
  222. marTop: 0,
  223. switchNum: 1,
  224. sysHeight: sysHeight,
  225. categoryList: [],
  226. navActive: 0,
  227. categoryTitle: '',
  228. categoryErList: [],
  229. tabLeft: 0,
  230. isWidth: 0, //每个导航栏占位
  231. tabClick: 0, //导航栏被点击
  232. iSlong: true,
  233. tempArr: [],
  234. loading: false,
  235. loadend: false,
  236. loadTitle: '加载更多',
  237. page: 1,
  238. limit: 10,
  239. cid: 0, //一级分类
  240. sid: 0, //二级分类
  241. delivery_type:3, // 配送方式
  242. isAuto: false, //没有授权的不会自动授权
  243. isShowAuth: false, //是否隐藏授权
  244. attr: {
  245. cartAttr: false,
  246. productAttr: [],
  247. productSelect: {}
  248. },
  249. productValue: [],
  250. attrValue: '', //已选属性
  251. storeName: '', //多属性产品名称
  252. id: 0,
  253. cartData: {
  254. cartList: [],
  255. iScart: false
  256. },
  257. totalPrice: 0.00,
  258. lengthCart: 0,
  259. is_vip: 0, //是否是会员
  260. cart_num: 0,
  261. storeInfo: {},
  262. address: {
  263. address: false
  264. }, //地址组件
  265. cartNum: 0
  266. }
  267. },
  268. watch: {
  269. info(newValue, oldValue) {
  270. this.switchNum = newValue.delivery_type == 3 ? 1 : newValue.delivery_type
  271. }
  272. },
  273. mounted() {
  274. let that = this;
  275. // 获取设备宽度
  276. uni.getSystemInfo({
  277. success(e) {
  278. that.isWidth = e.windowWidth / 5
  279. }
  280. });
  281. // #ifdef MP
  282. this.$nextTick(this.getMarTop);
  283. // #endif
  284. },
  285. methods: {
  286. // 授权回调
  287. onLoadFun() {
  288. setTimeout(function(){
  289. this.isShowAuth = false;
  290. },10)
  291. },
  292. // 授权关闭
  293. authColse: function(e) {
  294. this.isShowAuth = e
  295. },
  296. updateFun(e) {
  297. if (e.cartNum) {
  298. this.tempArr.forEach((item) => {
  299. if (item.id == e.id) {
  300. item.cart_num = e.cartNum
  301. }
  302. })
  303. }
  304. },
  305. // 商品列表
  306. getProducts() {
  307. let that = this;
  308. if (that.loadend) return;
  309. if (that.loading) return;
  310. that.loading = true;
  311. getProducts({
  312. page: that.page,
  313. limit: that.limit,
  314. type: 1,
  315. cid: that.cid,
  316. sid: that.sid,
  317. store_id: that.info.id,
  318. delivery_type:that.info.delivery_type,
  319. collate_code_id:that.info.collage_id
  320. }).then(res => {
  321. console.log(res,'res')
  322. let list = res.data,
  323. loadend = list.length < that.limit;
  324. that.tempArr = that.$util.SplitArray(list, that.tempArr);
  325. that.$set(that, 'tempArr', that.tempArr);
  326. that.loading = false;
  327. that.loadend = loadend;
  328. that.loadTitle = loadend ? "没有更多内容啦~" : "加载更多";
  329. that.page = that.page + 1;
  330. }).catch(err => {
  331. that.loading = false;
  332. that.loadTitle = '加载更多'
  333. });
  334. },
  335. // 切换自提方式
  336. swithFn(num) {
  337. switch (num) {
  338. case 1:
  339. this.switchNum = 1
  340. this.delivery_type = '3'
  341. break;
  342. case 2:
  343. this.switchNum = 2
  344. this.delivery_type='2'
  345. break;
  346. }
  347. this.page = 1;
  348. this.loadend = false;
  349. this.tempArr = []
  350. this.getProducts()
  351. },
  352. // 跳转到门店列表
  353. // goMap(val) {
  354. // uni.navigateTo({
  355. // url: `/pages/store/map/index?isGroup=${val}&storeFrom=1&type=1&storeId=${this.info.id}`,
  356. // success(res) {
  357. // console.log('成功啦', res);
  358. // },
  359. // fail(err) {
  360. // console.log('失败啦', err);
  361. // }
  362. // })
  363. // },
  364. getMarTop() {
  365. // #ifdef MP || APP-PLUS
  366. let that = this;
  367. setTimeout(() => {
  368. // 获取小程序头部高度
  369. let info = uni.createSelectorQuery().in(this).select(".mp-header");
  370. info.boundingClientRect(function(data) {
  371. that.marTop = data.height
  372. }).exec()
  373. }, 100)
  374. // #endif
  375. },
  376. // 生成订单;
  377. subOrder: function() {
  378. uni.navigateBack();
  379. },
  380. // 计算总价;
  381. getTotalPrice: function() {
  382. let that = this,
  383. list = that.cartData.cartList,
  384. totalPrice = 0.00;
  385. list.forEach(item => {
  386. totalPrice = that.$util.$h.Add(totalPrice, that.$util.$h.Mul(item.cart_num, item.truePrice));
  387. })
  388. that.$set(that, 'totalPrice', totalPrice);
  389. },
  390. ChangeSubDel: function(event) {
  391. emptyCollagePartake({
  392. collage_id: this.info.collage_id
  393. }).then(res => {
  394. this.$util.Tips({
  395. title: '清空成功',
  396. success: () => {
  397. this.cartData.iScart = false
  398. this.getCartNum();
  399. for (let i = 0; i < this.tempArr.length; i++) {
  400. if (!this.tempArr[i].cart_num) {
  401. continue;
  402. }
  403. this.tempArr[i].cart_num = 0;
  404. }
  405. }
  406. });
  407. });
  408. // let that = this,
  409. // list = that.cartData.cartList,
  410. // ids = [],
  411. // storeId = uni.getStorageSync('user_store_id');
  412. // list.forEach(item => {
  413. // ids.push(item.id)
  414. // });
  415. // cartDel(ids.join(","),storeId).then(res => {
  416. // that.$set(that.cartData, 'cartList', []);
  417. // that.cartData.iScart = false;
  418. // that.totalPrice = 0.00;
  419. // that.page = 1;
  420. // that.loadend = false;
  421. // that.tempArr = [];
  422. // that.getProducts();
  423. // that.getCartNum();
  424. // })
  425. },
  426. ChangeOneDel: function(id, index) {
  427. let that = this,
  428. list = that.cartData.cartList,
  429. storeId = uni.getStorageSync('user_store_id');
  430. cartDel(id.toString(),storeId).then(res => {
  431. list.splice(index, 1);
  432. if (!list.length) {
  433. that.cartData.iScart = false;
  434. that.page = 1;
  435. that.loadend = false;
  436. that.tempArr = [];
  437. that.getProducts();
  438. };
  439. that.getCartNum();
  440. })
  441. },
  442. // 获取购物车商品列表
  443. getCartList(iSshow) {
  444. let that = this;
  445. let data = {
  446. store_id:that.info.id,
  447. collage_id:that.info.collage_id,
  448. };
  449. getCollageCart(data).then(res => {
  450. that.$set(that.cartData, 'cartList', res.data);
  451. if (res.data.length) {
  452. that.$set(that.cartData, 'iScart', iSshow ? false : !that.cartData.iScart);
  453. } else {
  454. that.$set(that.cartData, 'iScart', false);
  455. }
  456. that.getTotalPrice();
  457. });
  458. },
  459. // 关闭购物车弹窗
  460. closeList(e) {
  461. this.$set(this.cartData, 'iScart', e);
  462. },
  463. getCartNum: function() {
  464. getCollageCount({
  465. store_id: this.info.id,
  466. collage_id: this.info.collage_id
  467. }).then(res => {
  468. this.cartNum = res.data.count;
  469. });
  470. },
  471. onMyEvent: function() {
  472. this.$set(this.attr, 'cartAttr', false);
  473. },
  474. /**
  475. * 默认选中属性
  476. *
  477. */
  478. DefaultSelect: function() {
  479. let productAttr = this.attr.productAttr;
  480. let value = [];
  481. for (let key in this.productValue) {
  482. if (this.productValue[key].stock > 0) {
  483. value = this.attr.productAttr.length ? key.split(",") : [];
  484. break;
  485. }
  486. }
  487. for (let i = 0; i < productAttr.length; i++) {
  488. this.$set(productAttr[i], "index", value[i]);
  489. }
  490. //sort();排序函数:数字-英文-汉字;
  491. let productSelect = this.productValue[value.join(",")];
  492. if (productSelect && productAttr.length) {
  493. this.$set(
  494. this.attr.productSelect,
  495. "store_name",
  496. this.storeName
  497. );
  498. this.$set(this.attr.productSelect, "image", productSelect.image);
  499. this.$set(this.attr.productSelect, "price", productSelect.price);
  500. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  501. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  502. this.$set(this.attr.productSelect, "cart_num", 1);
  503. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  504. this.$set(this, "attrValue", value.join(","));
  505. } else if (!productSelect && productAttr.length) {
  506. this.$set(
  507. this.attr.productSelect,
  508. "store_name",
  509. this.storeName
  510. );
  511. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  512. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  513. this.$set(this.attr.productSelect, "stock", 0);
  514. this.$set(this.attr.productSelect, "unique", "");
  515. this.$set(this.attr.productSelect, "cart_num", 0);
  516. this.$set(this, "attrValue", "");
  517. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  518. } else if (!productSelect && !productAttr.length) {
  519. this.$set(
  520. this.attr.productSelect,
  521. "store_name",
  522. this.storeName
  523. );
  524. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  525. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  526. this.$set(this.attr.productSelect, "stock", this.storeInfo.stock);
  527. this.$set(
  528. this.attr.productSelect,
  529. "unique",
  530. this.storeInfo.unique || ""
  531. );
  532. this.$set(this.attr.productSelect, "cart_num", 1);
  533. this.$set(this, "attrValue", "");
  534. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  535. }
  536. },
  537. /**
  538. * 属性变动赋值
  539. *
  540. */
  541. ChangeAttr: function(res) {
  542. let productSelect = this.productValue[res];
  543. if (productSelect && productSelect.stock > 0) {
  544. this.$set(this.attr.productSelect, "image", productSelect.image);
  545. this.$set(this.attr.productSelect, "price", productSelect.price);
  546. this.$set(this.attr.productSelect, "stock", productSelect.stock);
  547. this.$set(this.attr.productSelect, "unique", productSelect.unique);
  548. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  549. this.$set(this.attr.productSelect, "cart_num", 1);
  550. this.$set(this, "attrValue", res);
  551. } else if (productSelect && productSelect.stock == 0) {
  552. this.$set(this.attr.productSelect, "image", productSelect.image);
  553. this.$set(this.attr.productSelect, "price", productSelect.price);
  554. this.$set(this.attr.productSelect, "stock", 0);
  555. this.$set(this.attr.productSelect, "unique", "");
  556. this.$set(this.attr.productSelect, 'vip_price', productSelect.vip_price);
  557. this.$set(this.attr.productSelect, "cart_num", 0);
  558. this.$set(this, "attrValue", "");
  559. } else {
  560. this.$set(this.attr.productSelect, "image", this.storeInfo.image);
  561. this.$set(this.attr.productSelect, "price", this.storeInfo.price);
  562. this.$set(this.attr.productSelect, "stock", 0);
  563. this.$set(this.attr.productSelect, "unique", "");
  564. this.$set(this.attr.productSelect, 'vip_price', this.storeInfo.vip_price);
  565. this.$set(this.attr.productSelect, "cart_num", 0);
  566. this.$set(this, "attrValue", "");
  567. }
  568. },
  569. attrVal(val) {
  570. this.$set(this.attr.productAttr[val.indexw], 'index', this.attr.productAttr[val.indexw].attr_values[val
  571. .indexn]);
  572. },
  573. /**
  574. * 购物车手动填写
  575. *
  576. */
  577. iptCartNum: function(e) {
  578. this.$set(this.attr.productSelect, 'cart_num', e);
  579. },
  580. // 点击默认单属性购物车
  581. goCartDan(item, index) {
  582. if (!this.isLogin) {
  583. this.getIsLogin();
  584. } else {
  585. this.tempArr[index].cart_num = 1;
  586. this.$set(this, 'tempArr', this.tempArr);
  587. this.goCat(0, item.id, 1);
  588. }
  589. },
  590. // 改变单属性购物车
  591. ChangeCartNumDan(changeValue, index, item) {
  592. let num = this.tempArr[index];
  593. let stock = this.tempArr[index].stock;
  594. this.ChangeCartNum(changeValue, num, stock, 0, item.id);
  595. },
  596. // 改变多属性购物车
  597. ChangeCartNumDuo(changeValue) {
  598. //获取当前变动属性
  599. let productSelect = this.productValue[this.attrValue];
  600. //如果没有属性,赋值给商品默认库存
  601. if (productSelect === undefined && !this.attr.productAttr.length)
  602. productSelect = this.attr.productSelect;
  603. //无属性值即库存为0;不存在加减;
  604. if (productSelect === undefined) return;
  605. let stock = productSelect.stock || 0;
  606. let num = this.attr.productSelect;
  607. this.ChangeCartNum(changeValue, num, stock, 1, this.id);
  608. },
  609. // 已经加入购物车时的购物加减;
  610. ChangeCartList(changeValue, index) {
  611. let list = this.cartData.cartList;
  612. let num = list[index];
  613. let stock = list[index].trueStock;
  614. this.ChangeCartNum(changeValue, num, stock, 0, num.product_id, index, 1);
  615. if (!list.length) {
  616. this.cartData.iScart = false;
  617. this.page = 1;
  618. this.loadend = false;
  619. this.tempArr = [];
  620. this.getProducts();
  621. }
  622. },
  623. // 购物车加减计算函数
  624. ChangeCartNum(changeValue, num, stock, isDuo, id, index, cart) {
  625. if (changeValue) {
  626. num.cart_num++;
  627. if (num.cart_num > stock) {
  628. if (isDuo) {
  629. this.$set(this.attr.productSelect, "cart_num", stock ? stock : 1);
  630. this.$set(this, "cart_num", stock ? stock : 1);
  631. } else {
  632. num.cart_num = stock ? stock : 0;
  633. this.$set(this, 'tempArr', this.tempArr);
  634. this.$set(this.cartData, 'cartList', this.cartData.cartList);
  635. }
  636. return this.$util.Tips({
  637. title: "该产品没有更多库存了"
  638. });
  639. } else {
  640. if (!isDuo) {
  641. if (cart) {
  642. this.goCat(0, id, 1, 1, num.product_attr_unique);
  643. this.getTotalPrice();
  644. this.tempArr.forEach((item) => {
  645. if (item.id == id) {
  646. item.cart_num++;
  647. }
  648. })
  649. } else {
  650. this.goCat(0, id, 1);
  651. }
  652. } else {
  653. this.tempArr.forEach((item) => {
  654. if (item.id == id) {
  655. item.cart_num++;
  656. }
  657. })
  658. }
  659. }
  660. } else {
  661. num.cart_num--;
  662. if (num.cart_num == 0) {
  663. this.cartData.cartList.splice(index, 1);
  664. if (isDuo) {
  665. this.$set(this.attr.productSelect, "cart_num", 1);
  666. this.$set(this, "cart_num", 1);
  667. }
  668. }
  669. if (num.cart_num < 0) {
  670. if (isDuo) {
  671. this.$set(this.attr.productSelect, "cart_num", 1);
  672. this.$set(this, "cart_num", 1);
  673. } else {
  674. num.cart_num = 0;
  675. this.$set(this, 'tempArr', this.tempArr);
  676. this.$set(this.cartData, 'cartList', this.cartData.cartList);
  677. }
  678. } else {
  679. if (!isDuo) {
  680. if (cart) {
  681. this.goCat(0, id, 0, 1, num.product_attr_unique);
  682. this.getTotalPrice();
  683. this.tempArr.forEach((item) => {
  684. if (item.id == id) {
  685. item.cart_num--;
  686. }
  687. })
  688. } else {
  689. this.goCat(0, id, 0);
  690. }
  691. } else {
  692. this.tempArr.forEach((item) => {
  693. if (item.id == id) {
  694. item.cart_num--;
  695. }
  696. })
  697. }
  698. }
  699. }
  700. },
  701. // 多规格加入购物车;
  702. goCatNum() {
  703. this.goCat(1, this.id, 1);
  704. },
  705. /*
  706. * 加入购物车
  707. */
  708. goCat: function(duo, id, type, cart, unique) {
  709. let that = this;
  710. if (duo) {
  711. let productSelect = that.productValue[this.attrValue];
  712. //如果有属性,没有选择,提示用户选择
  713. if (
  714. that.attr.productAttr.length &&
  715. productSelect === undefined
  716. )
  717. return that.$util.Tips({
  718. title: "产品库存不足,请选择其它属性"
  719. });
  720. }
  721. let q = {
  722. productId: id,
  723. cartNum: duo ? that.attr.productSelect.cart_num : 1,
  724. collageId: this.info.collage_id,
  725. storeId: this.info.id,
  726. uniqueId: duo ? that.attr.productSelect.unique : cart ? unique : "",
  727. isAdd: type
  728. };
  729. addCollageCart(q).then(res => {
  730. if (duo) {
  731. that.attr.cartAttr = false;
  732. that.$util.Tips({
  733. title: "添加购物车成功"
  734. });
  735. that.tempArr.forEach((item, index) => {
  736. if (item.id == that.id) {
  737. let arrtStock = that.attr.productSelect.stock
  738. let objNum = parseInt(item.cart_num) + parseInt(that.attr.productSelect.cart_num);
  739. item.cart_num = objNum > arrtStock ? arrtStock : objNum
  740. }
  741. })
  742. }
  743. that.getCartNum();
  744. if (!cart) {
  745. that.getCartList(1);
  746. }
  747. }).catch(err => {
  748. that.$util.Tips({
  749. title: err
  750. });
  751. });;
  752. // postCartNum(q)
  753. // .then(function(res) {
  754. // if (duo) {
  755. // that.attr.cartAttr = false;
  756. // that.$util.Tips({
  757. // title: "添加购物车成功"
  758. // });
  759. // // that.page = 1;
  760. // // that.loadend = false;
  761. // that.tempArr.forEach((item, index) => {
  762. // if (item.id == that.id) {
  763. // let arrtStock = that.attr.productSelect.stock
  764. // let objNum = parseInt(item.cart_num) + parseInt(that.attr.productSelect.cart_num);
  765. // item.cart_num = objNum > arrtStock ? arrtStock : objNum
  766. // }
  767. // })
  768. // // that.productslist();
  769. // }
  770. // that.getCartNum();
  771. // if (!cart) {
  772. // that.getCartList(1);
  773. // }
  774. // })
  775. // .catch(err => {
  776. // return that.$util.Tips({
  777. // title: err
  778. // });
  779. // });
  780. },
  781. goCartDuo(item) {
  782. if (!this.isLogin) {
  783. this.getIsLogin();
  784. } else {
  785. // uni.showLoading({
  786. // title: '加载中'
  787. // });
  788. this.storeName = item.store_name;
  789. this.getAttrs(item.id);
  790. this.$set(this, 'id', item.id);
  791. this.$set(this.attr, 'cartAttr', true);
  792. }
  793. },
  794. getIsLogin() {
  795. toLogin();
  796. },
  797. // 商品详情接口;
  798. getAttrs(id) {
  799. let that = this;
  800. getAttr(id, 0).then(res => {
  801. // uni.hideLoading();
  802. that.$set(that.attr, 'productAttr', res.data.productAttr);
  803. that.$set(that, 'productValue', res.data.productValue);
  804. that.$set(that, 'is_vip', res.data.storeInfo.is_vip);
  805. that.$set(that, 'storeInfo', res.data.storeInfo);
  806. that.DefaultSelect();
  807. })
  808. },
  809. // 去详情页
  810. goDetail(item) {
  811. goShopDetail(item, this.uid).then(res => {
  812. uni.navigateTo({
  813. url: `/pages/goods_details/index?id=${item.id}&fromType=1`
  814. });
  815. });
  816. },
  817. openTap() {
  818. this.iSlong = false
  819. },
  820. closeTap() {
  821. this.iSlong = true
  822. },
  823. // 分类数据
  824. getAllCategory: function() {
  825. let that = this;
  826. getStoreCategory().then(res => {
  827. let data = res.data;
  828. data.forEach(item => {
  829. item.children.unshift({
  830. 'id': 0,
  831. 'cate_name': '全部'
  832. })
  833. })
  834. that.categoryTitle = data[0].cate_name;
  835. that.cid = data[0].id;
  836. that.sid = 0;
  837. that.navActive = 0;
  838. that.tabClick = 0;
  839. that.categoryList = data;
  840. that.categoryErList = res.data[0].children ? res.data[0].children : [];
  841. that.page = 1;
  842. that.loadend = false;
  843. that.tempArr = [];
  844. that.getProducts();
  845. })
  846. },
  847. tapNav(index, item) {
  848. uni.pageScrollTo({
  849. duration: 0,
  850. scrollTop: 0
  851. })
  852. let list = this.categoryList[index];
  853. this.navActive = index;
  854. this.categoryTitle = list.cate_name;
  855. this.categoryErList = item.children ? item.children : [];
  856. this.tabClick = 0;
  857. this.tabLeft = 0;
  858. this.cid = list.id;
  859. this.sid = 0;
  860. this.page = 1;
  861. this.loadend = false;
  862. this.tempArr = [];
  863. this.getProducts();
  864. },
  865. // 导航栏点击
  866. longClick(index) {
  867. if (this.categoryErList.length > 3) {
  868. this.tabLeft = (index - 1) * (this.isWidth + 6) //设置下划线位置
  869. };
  870. this.tabClick = index; //设置导航点击了哪一个
  871. this.iSlong = true;
  872. this.sid = this.categoryErList[index].id;
  873. this.page = 1;
  874. this.loadend = false;
  875. this.tempArr = [];
  876. this.getProducts();
  877. },
  878. },
  879. onReachBottom: function() {
  880. this.getProducts();
  881. }
  882. }
  883. </script>
  884. <style lang="scss">
  885. /* #ifdef MP || APP-PLUS */
  886. .mp-header {
  887. z-index: 100;
  888. position: fixed;
  889. left: 0;
  890. top: 0;
  891. width: 100%;
  892. background: #fff;
  893. border-bottom: 1px solid #F0F0F0;
  894. .serch-wrapper {
  895. height: 100%;
  896. /* #ifdef MP */
  897. padding: 0 220rpx 0 30rpx;
  898. /* #endif */
  899. /* #ifdef APP-PLUS */
  900. padding: 0 50rpx 0 40rpx;
  901. /* #endif */
  902. .input {
  903. flex: 1;
  904. height: 55rpx;
  905. margin: 0 0 0 30rpx;
  906. background: #F8F8F8;
  907. color: #ADADAD;
  908. font-size: 26rpx;
  909. /* #ifdef MP */
  910. width: 70%;
  911. /* #endif */
  912. /* #ifdef APP-PLUS */
  913. width: 100%;
  914. /* #endif */
  915. border-radius: 50rpx;
  916. .iconfont {
  917. margin-right: 20rpx;
  918. }
  919. }
  920. }
  921. }
  922. /* #endif */
  923. page {
  924. background-color: #fff;
  925. }
  926. /deep/.product-window.joinCart {
  927. z-index: 999;
  928. }
  929. ::-webkit-scrollbar {
  930. width: 0;
  931. height: 0;
  932. color: transparent;
  933. display: none;
  934. }
  935. .goodCate {
  936. /deep/.mask {
  937. z-index: 99;
  938. }
  939. /deep/.attrProduct {
  940. .mask {
  941. z-index: 100;
  942. }
  943. }
  944. .header {
  945. position: fixed;
  946. background-color: #fff;
  947. top: 0;
  948. left: 0;
  949. width: 100%;
  950. z-index: 99;
  951. border-bottom: 1px solid #F0F0F0;
  952. /* #ifdef H5 */
  953. padding-top: 20rpx;
  954. /* #endif */
  955. .pageIndex {
  956. width: 68rpx;
  957. height: 68rpx;
  958. border-radius: 50%;
  959. background-color: #F7F7F7;
  960. .iconfont {
  961. color: #666666;
  962. font-size: 30rpx;
  963. }
  964. // image{
  965. // width: 29rpx;
  966. // height: 30rpx;
  967. // }
  968. }
  969. .search {
  970. width: 690rpx;
  971. height: 68rpx;
  972. border-radius: 36rpx;
  973. background-color: #F7F7F7;
  974. font-size: 26rpx;
  975. color: #cccccc;
  976. padding: 0 30rpx;
  977. box-sizing: border-box;
  978. .iconfont {
  979. font-size: 30rpx;
  980. margin-right: 18rpx;
  981. color: #666666;
  982. }
  983. }
  984. }
  985. .conter {
  986. /* #ifdef H5 */
  987. padding-top: 288rpx;
  988. /* #endif */
  989. height: 100vh;
  990. background-color: #fff;
  991. .aside {
  992. position: fixed;
  993. width: 23%;
  994. left: 0;
  995. bottom: 0;
  996. /* #ifdef H5 */
  997. top: 288rpx;
  998. /* #endif */
  999. background-color: #F7F7F7;
  1000. overflow-y: auto;
  1001. overflow-x: hidden;
  1002. /* #ifdef H5 */
  1003. // margin-top: 128rpx;
  1004. /* #endif */
  1005. z-index: 99;
  1006. padding-bottom: 194rpx;
  1007. .item {
  1008. height: 100rpx;
  1009. width: 100%;
  1010. font-size: 26rpx;
  1011. color: #333333;
  1012. &.on {
  1013. background-color: #FFFFFF;
  1014. width: 100%;
  1015. text-align: center;
  1016. color: var(--view-theme);
  1017. font-weight: 500;
  1018. position: relative;
  1019. &::after {
  1020. content: "";
  1021. position: absolute;
  1022. width: 6rpx;
  1023. height: 46rpx;
  1024. background: var(--view-theme);
  1025. border-radius: 0 4rpx 4rpx 0;
  1026. left: 0
  1027. }
  1028. }
  1029. }
  1030. }
  1031. .wrapper {
  1032. margin-top: 104rpx;
  1033. padding-bottom: 250rpx;
  1034. /* #ifdef H5 */
  1035. padding-bottom: 200rpx;
  1036. /* #endif */
  1037. width: 77%;
  1038. float: right;
  1039. background-color: #FFFFFF;
  1040. // padding-bottom: 240rpx;
  1041. .bgcolor {
  1042. width: 100%;
  1043. background-color: #FFFFFF;
  1044. }
  1045. // .goodsList {
  1046. // margin-top: 0 !important;
  1047. // }
  1048. .mask {
  1049. z-index: 9;
  1050. }
  1051. .longTab {
  1052. width: 65%;
  1053. position: fixed;
  1054. /* #ifdef H5 */
  1055. top: 288rpx;
  1056. /* #endif */
  1057. height: 100rpx;
  1058. z-index: 99;
  1059. background-color: #FFFFFF;
  1060. .longItem {
  1061. height: 44rpx;
  1062. display: inline-block;
  1063. line-height: 44rpx;
  1064. text-align: center;
  1065. font-size: 26rpx;
  1066. overflow: hidden;
  1067. text-overflow: ellipsis;
  1068. white-space: nowrap;
  1069. color: #333333;
  1070. background-color: #F7F7F7;
  1071. border-radius: 22rpx;
  1072. margin-left: 12rpx;
  1073. &.click {
  1074. font-weight: bold;
  1075. background-color: var(--view-theme);
  1076. color: #ffffff;
  1077. }
  1078. }
  1079. .underlineBox {
  1080. height: 3px;
  1081. width: 20%;
  1082. display: flex;
  1083. align-content: center;
  1084. justify-content: center;
  1085. transition: .5s;
  1086. .underline {
  1087. width: 33rpx;
  1088. height: 4rpx;
  1089. background-color: #FFFFFF;
  1090. }
  1091. }
  1092. }
  1093. .openList {
  1094. width: 12%;
  1095. height: 100rpx;
  1096. background-color: #FFFFFF;
  1097. line-height: 100rpx;
  1098. padding-left: 30rpx;
  1099. position: fixed;
  1100. right: 0;
  1101. /* #ifdef H5 */
  1102. top: 288rpx;
  1103. /* #endif */
  1104. z-index: 99;
  1105. .iconfont {
  1106. font-size: 22rpx;
  1107. color: #666666;
  1108. }
  1109. }
  1110. .downTab {
  1111. width: 78%;
  1112. position: fixed;
  1113. top: 0rpx;
  1114. /* #ifdef H5 */
  1115. top: 288rpx;
  1116. /* #endif */
  1117. z-index: 102;
  1118. background-color: #FFFFFF;
  1119. .title {
  1120. height: 100rpx;
  1121. font-size: 26rpx;
  1122. color: #999999;
  1123. padding-left: 20rpx;
  1124. .closeList {
  1125. width: 90rpx;
  1126. height: 100%;
  1127. line-height: 100rpx;
  1128. padding-left: 30rpx;
  1129. transform: rotate(180deg);
  1130. .iconfont {
  1131. font-size: 22rpx;
  1132. color: #666666;
  1133. }
  1134. }
  1135. }
  1136. .children {
  1137. max-height: 500rpx;
  1138. overflow-x: hidden;
  1139. overflow-y: auto;
  1140. padding-bottom: 20rpx;
  1141. .item {
  1142. height: 60rpx;
  1143. background-color: #F7F7F7;
  1144. border-radius: 30rpx;
  1145. line-height: 60rpx;
  1146. padding: 0 15rpx;
  1147. margin: 0 0 20rpx 20rpx;
  1148. width: 165rpx;
  1149. text-align: center;
  1150. &.click {
  1151. font-weight: bold;
  1152. background-color: var(--view-theme);
  1153. color: #ffffff;
  1154. }
  1155. }
  1156. }
  1157. }
  1158. .goodsList {
  1159. margin-top: 0rpx;
  1160. padding: 0 30rpx 0 20rpx;
  1161. /deep/.item {
  1162. margin-bottom: 33rpx !important;
  1163. .text {
  1164. font-size: 26rpx;
  1165. }
  1166. .bottom {
  1167. .sales {
  1168. .money {
  1169. font-size: 34rpx;
  1170. text {
  1171. font-size: 26rpx;
  1172. }
  1173. }
  1174. }
  1175. .cart {
  1176. .pictrue {
  1177. width: 50rpx;
  1178. height: 50rpx;
  1179. }
  1180. }
  1181. }
  1182. }
  1183. }
  1184. }
  1185. }
  1186. .store-address {
  1187. width: 100%;
  1188. margin-top: 15rpx;
  1189. position: relative;
  1190. padding: 12rpx 30rpx 0 30rpx;
  1191. height: 185rpx;
  1192. background-color: #fff;
  1193. .address {
  1194. font-size: 32rpx;
  1195. font-weight: 500;
  1196. color: #333333;
  1197. .name{
  1198. max-width: 400rpx;
  1199. }
  1200. .icon-xiangyou {
  1201. font-size: 24rpx;
  1202. margin-left: 10rpx;
  1203. }
  1204. }
  1205. .distance {
  1206. margin-top: 16rpx;
  1207. font-size: 24rpx;
  1208. font-weight: 400;
  1209. color: #999999;
  1210. }
  1211. .time {
  1212. margin-top: 16rpx;
  1213. font-size: 24rpx;
  1214. font-weight: 400;
  1215. color: #333333;
  1216. }
  1217. .switch {
  1218. position: absolute;
  1219. top: 15rpx;
  1220. /* #ifdef H5 */
  1221. top: 20rpx;
  1222. /* #endif */
  1223. right: 30rpx;
  1224. // width: 194rpx;
  1225. height: 58rpx;
  1226. background: #F5F5F5;
  1227. border-radius: 33rpx;
  1228. .title {
  1229. width: 82rpx;
  1230. height: 100%;
  1231. line-height: 58rpx;
  1232. border-radius: 33rpx;
  1233. text-align: center;
  1234. padding-right: 20rpx;
  1235. &.onLeft {
  1236. padding-left: 20rpx;
  1237. padding-right: 0;
  1238. }
  1239. &.on {
  1240. width: 100rpx;
  1241. background-color: var(--view-theme) !important;
  1242. color: #fff;
  1243. padding: 0 !important;
  1244. }
  1245. }
  1246. }
  1247. }
  1248. .footer {
  1249. width: 100%;
  1250. position: fixed;
  1251. left: 0;
  1252. background-color: #fff;
  1253. box-shadow: 0px -3px 16px rgba(36, 12, 12, 0.05);
  1254. z-index: 100;
  1255. padding-left: 30rpx;
  1256. box-sizing: border-box;
  1257. height: 100rpx;
  1258. // #ifdef H5
  1259. bottom: 94rpx;
  1260. bottom: calc(94rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1261. bottom: calc(94rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1262. // #endif
  1263. // #ifndef H5
  1264. bottom: 98rpx;
  1265. bottom: calc(98rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  1266. bottom: calc(98rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  1267. // #endif
  1268. &.on {
  1269. // #ifndef H5
  1270. bottom: 0rpx;
  1271. // #endif
  1272. }
  1273. .cartIcon {
  1274. width: 80rpx;
  1275. height: 80rpx;
  1276. border-radius: 50%;
  1277. position: relative;
  1278. margin-top: -36rpx;
  1279. .iconfont {
  1280. font-size: 94rpx;
  1281. margin-top: 12rpx;
  1282. color: var(--view-theme);
  1283. }
  1284. &.noCart {
  1285. .iconfont {
  1286. color: #CBCBCB;
  1287. }
  1288. }
  1289. .num {
  1290. min-width: 14rpx;
  1291. background-color: #fff;
  1292. color: var(--view-theme);
  1293. border-radius: 15px;
  1294. position: absolute;
  1295. right: -10rpx;
  1296. top: 20rpx;
  1297. font-size: 20rpx;
  1298. padding: 0 10rpx;
  1299. border: 1px solid var(--view-theme);
  1300. }
  1301. }
  1302. .money {
  1303. font-size: 26rpx;
  1304. font-weight: bold;
  1305. color: var(--view-priceColor);
  1306. margin-right: 34rpx;
  1307. .num {
  1308. font-size: 34rpx;
  1309. }
  1310. }
  1311. .bnt {
  1312. width: 192rpx;
  1313. height: 76rpx;
  1314. background-color: var(--view-theme);
  1315. border-radius: 46px;
  1316. line-height: 76rpx;
  1317. text-align: center;
  1318. color: #fff;
  1319. font-size: 28rpx;
  1320. margin-right: 30rpx;
  1321. }
  1322. .noCart {
  1323. .money {
  1324. color: #CBCBCB;
  1325. }
  1326. .bnt {
  1327. background-color: #CBCBCB;
  1328. }
  1329. }
  1330. }
  1331. }
  1332. .group-btn {
  1333. display: flex;
  1334. justify-content: center;
  1335. align-items: center;
  1336. width: 140rpx;
  1337. height: 64rpx;
  1338. border: 1rpx solid #DDDDDD;
  1339. border-radius: 32rpx;
  1340. font-weight: 500;
  1341. font-size: 26rpx;
  1342. color: #333333;
  1343. cursor: pointer;
  1344. }
  1345. .dialog {
  1346. position: fixed;
  1347. right: 0;
  1348. bottom: 0;
  1349. left: 0;
  1350. z-index: 101;
  1351. padding: 36rpx 40rpx 40rpx;
  1352. border-radius: 12rpx 12rpx 0 0;
  1353. background-color: #FFFFFF;
  1354. transform: translateY(100%);
  1355. transition: 0.3s;
  1356. &.active {
  1357. transform: translateY(0);
  1358. }
  1359. }
  1360. .dialog-head {
  1361. display: flex;
  1362. .button {
  1363. flex: 1;
  1364. display: flex;
  1365. justify-content: center;
  1366. align-items: center;
  1367. height: 138rpx;
  1368. border: 4rpx solid #DDDDDD;
  1369. border-radius: 12rpx;
  1370. font-weight: 500;
  1371. font-size: 32rpx;
  1372. color: #333333;
  1373. cursor: pointer;
  1374. +.button {
  1375. margin-left: 46rpx;
  1376. }
  1377. &.active {
  1378. border: 4rpx solid var(--view-theme);
  1379. }
  1380. }
  1381. }
  1382. .dialog-body {
  1383. margin-top: 60rpx;
  1384. font-size: 24rpx;
  1385. color: #999999;
  1386. .dialog-body-main {
  1387. display: flex;
  1388. align-items: center;
  1389. margin-top: 32rpx;
  1390. }
  1391. .dialog-body-left {
  1392. flex: 1;
  1393. min-width: 0;
  1394. margin-right: 20rpx;
  1395. }
  1396. .dialog-body-right {
  1397. display: flex;
  1398. justify-content: center;
  1399. align-items: center;
  1400. width: 140rpx;
  1401. height: 46rpx;
  1402. border: 2rpx solid #DDDDDD;
  1403. border-radius: 23rpx;
  1404. font-size: 22rpx;
  1405. color: #666666;
  1406. cursor: pointer;
  1407. }
  1408. .dialog-body-name {
  1409. font-weight: 500;
  1410. font-size: 24rpx;
  1411. line-height: 1;
  1412. color: #333333;
  1413. .tag {
  1414. margin-left: 14rpx;
  1415. font-size: 24rpx;
  1416. color: #888888;
  1417. }
  1418. }
  1419. .dialog-body-info {
  1420. margin-top: 28rpx;
  1421. .item {
  1422. display: flex;
  1423. font-size: 22rpx;
  1424. line-height: 1.5;
  1425. color: #888888;
  1426. +.item {
  1427. margin-top: 20rpx;
  1428. }
  1429. }
  1430. }
  1431. }
  1432. .dialog-foot {
  1433. display: flex;
  1434. margin-top: 78rpx;
  1435. .button {
  1436. display: flex;
  1437. justify-content: center;
  1438. align-items: center;
  1439. flex: 1;
  1440. min-width: 0;
  1441. height: 92rpx;
  1442. border-radius: 46rpx;
  1443. background-color: #EEEEEE;
  1444. font-size: 30rpx;
  1445. color: #666666;
  1446. cursor: pointer;
  1447. +.button {
  1448. margin-left: 46rpx;
  1449. }
  1450. &.primary {
  1451. background-color: var(--view-theme);
  1452. color: #FFFFFF;
  1453. }
  1454. }
  1455. }
  1456. </style>