cart.vue 42 KB

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