user.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156
  1. <template>
  2. <view class="container">
  3. <scroll-view class="content-box" scroll-y="true">
  4. <view class="user-section">
  5. <view class="bg"></view>
  6. <view class="user-info-box ">
  7. <view class="detail flex" @click="navTo('/pages/userinfo/userinfo')">
  8. <view class="portrait-box"><image class="portrait" :src="userInfo.avatar || '/static/error/missing-face.png'"></image></view>
  9. <view class="info-box">
  10. <view class="username flex_item">
  11. <view class="clamp user-name">{{ userInfo.nickname || '游客' }}</view>
  12. <image v-if="userInfo.day_give > 0" class="image" src="https://shicai.liuniu946.com/img/img55.png"></image>
  13. <!-- <image src="../../static/img/img065.png" style="width: 103rpx;height: 32rpx;margin-left: 20rpx;margin-right: 7rpx;"></image>
  14. <image src="../../static/img/img066.png" style="width: 106rpx;height: 32rpx;"></image> -->
  15. </view>
  16. <view class="member" v-if="userInfo != '' && grade > 0">
  17. <image class="img" src="/static/img/img10.png"></image>
  18. <text class="grade">{{ userInfo.level_info.name }}</text>
  19. </view>
  20. <view class="phone" v-if="userInfo.phone !=null">手机号:{{ userInfo.phone }}</view>
  21. </view>
  22. </view>
  23. <view class="config iconfont"><text class="message iconmessage" @click="navTo('/pages/notice/notice')"></text></view>
  24. </view>
  25. <!-- 美卡卡功能 -->
  26. <!-- <view v-if="userInfo == ''">
  27. <view class="notice-box">
  28. <uni-notice-bar class="notice-bar" color="#84592F" showIcon="true" single="true" text="美卡权益大升级,加入美卡,即享4大权益"></uni-notice-bar>
  29. </view>
  30. <view class="vip-card-box">
  31. <view class="card-img"><image src="../../static/img/img11.png"></image></view>
  32. <view class="b-btn" @click="navTo('/pages/user/card')">
  33. 立即开通
  34. <text class="iconfont iconenter"></text>
  35. </view>
  36. <view class="tit">
  37. 优享美卡
  38. <text class="tpl">开通即享4大权益</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view v-if="userInfo != ''">
  43. <view class="notice-box">
  44. <uni-notice-bar class="notice-bar" v-if="grade < 100" color="#84592F" showIcon="true" single="true" :text="text"></uni-notice-bar>
  45. <uni-notice-bar
  46. class="notice-bar"
  47. v-if="grade > 99"
  48. color="#84592F"
  49. showIcon="true"
  50. single="true"
  51. :text="'您已升级为正式美卡,还剩' + userInfo.level_valid_day + '天到期'"
  52. ></uni-notice-bar>
  53. </view>
  54. <view class="vip-card-box">
  55. <view class="card-img"><image src="../../static/img/img11.png"></image></view>
  56. <view class="b-btn" @click="Tomember" v-if="grade < 100">
  57. 立即开通
  58. <text class="iconfont iconenter"></text>
  59. </view>
  60. <view class="b-btn" @click="Tomember" v-if="grade > 99">
  61. 立即续费
  62. <text class="iconfont iconenter"></text>
  63. </view>
  64. <view class="tit" v-if="grade < 100">
  65. 优享美卡
  66. <text class="tpl">开通即享4大权益</text>
  67. </view>
  68. <view class="tit flex_item" v-if="grade > 99">
  69. <view class="img"><image src="/static/img/img10.png"></image></view>
  70. <view class="tpl">您已开通美卡</view>
  71. </view>
  72. </view>
  73. </view> -->
  74. </view>
  75. <view class="card-box-list flex">
  76. <view class="coupon-list" @click="navTo('/pages/coupon/coupon')">
  77. <view class="number">{{userInfo.discount_coupon_count}}<text class="text">张</text></view>
  78. <view class="name">优惠券</view>
  79. </view>
  80. <view class="fenge"></view>
  81. <view class="coupon-list" @click="navTo('/pages/commission/orderGroup')">
  82. <view class="number">{{userInfo.pink_prize || '0'}}<text class="text">元</text></view>
  83. <view class="name" style="text-align: right;">拼团收益</view>
  84. </view>
  85. </view>
  86. <view class="cover-container">
  87. <image class="arc" src="/static/img/arc.png"></image>
  88. <view class="item-box">
  89. <view class="box-title flex ">
  90. <view class="title"><text>我的订单</text></view>
  91. <view class="link" @click="navTo('/pages/order/order?state=0')" hover-class="common-hover">
  92. <text>全部订单</text>
  93. <text class="iconfont iconenter"></text>
  94. </view>
  95. </view>
  96. <view class="order-section">
  97. <view class="order-item" @click="navTo('/pages/order/order?state=0')" hover-class="common-hover" :hover-stay-time="50">
  98. <view class=" icon position-relative">
  99. <image class="icon-img" src="https://shicai.liuniu946.com/img/img24.png" mode="aspectFit"></image>
  100. <view class="corner" v-if="orderInfo.unpaid_count > 0">
  101. <text>{{ orderInfo.unpaid_count }}</text>
  102. </view>
  103. </view>
  104. <text class="order-text">待付款</text>
  105. </view>
  106. <view class="order-item" @click="navTo('/pages/order/order?state=1')" hover-class="common-hover" :hover-stay-time="50">
  107. <view class=" icon position-relative">
  108. <image class="icon-img" src="https://shicai.liuniu946.com/img/img25.png" mode="aspectFit"></image>
  109. <view class="corner" v-if="orderInfo.unshipped_count > 0">
  110. <text>{{ orderInfo.unshipped_count }}</text>
  111. </view>
  112. </view>
  113. <text class="order-text">备货中</text>
  114. </view>
  115. <view class="order-item" @click="navTo('/pages/order/order?state=2')" hover-class="common-hover" :hover-stay-time="50">
  116. <view class="icon position-relative">
  117. <image class="icon-img" src="https://shicai.liuniu946.com/img/img26.png" mode="aspectFit"></image>
  118. <view class="corner" v-if="orderInfo.received_count > 0">
  119. <text>{{ orderInfo.received_count }}</text>
  120. </view>
  121. </view>
  122. <text class="order-text">待收货</text>
  123. </view>
  124. <view class="order-item" @click="navTo('/pages/order/order?state=3')" hover-class="common-hover" :hover-stay-time="50">
  125. <view class="icon position-relative">
  126. <image class="icon-img" src="https://shicai.liuniu946.com/img/img27.png" mode="aspectFit"></image>
  127. <view class="corner" v-if="orderInfo.complete_count > 0">
  128. <text>{{ orderInfo.complete_count }}</text>
  129. </view>
  130. </view>
  131. <text class="order-text">评价</text>
  132. </view>
  133. </view>
  134. <view class="group-order" v-if="pinkList.length !== 0">
  135. <view class="group-order-list flex">
  136. <view class="list-img-box flex_item">
  137. <image :src="pinkContent.cartInfo[0].productInfo.image"></image>
  138. <view class="info">
  139. <view class="info-name">查看拼单</view>
  140. <view class="info-tip">正在拼单的是{{pinkContent.cartInfo[0].productInfo.store_name}}</view>
  141. </view>
  142. </view>
  143. <view class="btn-detai" @click="GoPinkdetails">查看详情</view>
  144. </view>
  145. </view>
  146. </view>
  147. <view class="arc-image"><image :src="image" @click="navTo('/pages/groupBooking/index')" mode="widthFix"></image></view>
  148. <view class="item-box">
  149. <view class="box-title flex ">
  150. <view class="title"><text>经理权益</text></view>
  151. </view>
  152. <view class="order-section">
  153. <view class="order-item" @click="navTo('/pages/notice/poster?id=5')" hover-class="common-hover" :hover-stay-time="50">
  154. <view class="icon"><image class="icon-img" src="/static/img/img60.png" mode="aspectFit"></image></view>
  155. <text>申请代表</text>
  156. </view>
  157. <view class="order-item" @click="toDaibiao(1)" hover-class="common-hover" :hover-stay-time="50">
  158. <view class="icon"><image class="icon-img" src="/static/img/img62.png" mode="aspectFit"></image></view>
  159. <text>代表提成</text>
  160. </view>
  161. <!-- <view class="order-item" hover-class="common-hover" :hover-stay-time="50">
  162. </view> -->
  163. <view class="order-item" @click="toDaibiao(2)" hover-class="common-hover" :hover-stay-time="50">
  164. <view class="icon"><image class="icon-img" src="/static/img/img61.png" mode="aspectFit"></image></view>
  165. <text>我的团队</text>
  166. </view>
  167. <view class="order-item" @click="toDaibiao(5)" hover-class="common-hover" :hover-stay-time="50">
  168. <view class="icon"><image class="icon-img" src="/static/img/img87.png" mode="aspectFit"></image></view>
  169. <text>预售接龙</text>
  170. </view>
  171. </view>
  172. </view>
  173. <!-- <view class="item-box">
  174. <view class="box-title flex">
  175. <view class="title"><text>我的服务</text></view>
  176. </view>
  177. <view class="order-section">
  178. <view class="order-item" @click="navTo('/pages/commission/orderGroup')" hover-class="common-hover" :hover-stay-time="50">
  179. <view class="icon"><image class="icon-img" src="/static/img/img83.png" mode="aspectFit"></image></view>
  180. <text>拼团收益</text>
  181. </view>
  182. <view class="order-item" @click="navTo('/pages/commission/commission')" hover-class="common-hover" :hover-stay-time="50">
  183. <view class="icon"><image class="icon-img" src="/static/img/img59.png" mode="aspectFit"></image></view>
  184. <text>我的钱包</text>
  185. </view>
  186. <view class="order-item" @click="navTo('/pages/team/team')" hover-class="common-hover" :hover-stay-time="50">
  187. <view class="icon"><image class="icon-img" src="/static/img/img61.png" mode="aspectFit"></image></view>
  188. <text>我的团队</text>
  189. </view>
  190. <view class="order-item" @click="navTo('/pages/coupon/coupon')" hover-class="common-hover" :hover-stay-time="50">
  191. <view class="icon"><image class="icon-img" src="/static/img/img28.png" mode="aspectFit"></image></view>
  192. <text>我的卡包</text>
  193. </view>
  194. </view>
  195. <view class="order-section">
  196. <view class="order-item" @click="navTo('/pages/address/address')" hover-class="common-hover" :hover-stay-time="50">
  197. <view class="icon"><image class="icon-img" src="/static/img/img29.png" mode="aspectFit"></image></view>
  198. <text>收货地址</text>
  199. </view>
  200. <view class="order-item" @click="navTo('/pages/address/addressPink')" hover-class="common-hover" :hover-stay-time="50">
  201. <view class="icon"><image class="icon-img" src="/static/img/img86.png" mode="aspectFit"></image></view>
  202. <text>拼团地址</text>
  203. </view>
  204. <view class="order-item" @click="navTo('/pages/service/service')" hover-class="common-hover" :hover-stay-time="50">
  205. <view class="icon"><image class="icon-img" src="/static/img/img31.png" mode="aspectFit"></image></view>
  206. <text>客服与帮助</text>
  207. </view>
  208. <view class="order-item" @click="navTo('/pages/shareQrCode/index?spread='+userInfo.uid)" hover-class="common-hover" :hover-stay-time="50">
  209. <view class="icon"><image class="icon-img" src="/static/img/img30.png" mode="aspectFit"></image></view>
  210. <text>邀请有礼</text>
  211. </view>
  212. </view>
  213. <view class="order-section lastSection">
  214. <view class="order-item" @click="navTo('/pages/set/set')" hover-class="common-hover" :hover-stay-time="50">
  215. <view class="icon"><image class="icon-img" src="/static/img/img32.png" mode="aspectFit"></image></view>
  216. <text>设置</text>
  217. </view>
  218. </view>
  219. </view> -->
  220. <view class="item-box">
  221. <view class="box-title flex">
  222. <view class="title"><text>拼团服务</text></view>
  223. </view>
  224. <view class="order-section">
  225. <view class="order-item" @click="navTo('/pages/commission/orderGroup')" hover-class="common-hover" :hover-stay-time="50">
  226. <view class="icon"><image class="icon-img" src="/static/img/img83.png" mode="aspectFit"></image></view>
  227. <text>拼团收益</text>
  228. </view>
  229. <view class="order-item" @click="navTo('/pages/address/addressPink')" hover-class="common-hover" :hover-stay-time="50">
  230. <view class="icon"><image class="icon-img" src="/static/img/img86.png" mode="aspectFit"></image></view>
  231. <text>拼团地址</text>
  232. </view>
  233. <view class="order-item" @click="navTo('/pages/shareQrCode/index?spread='+userInfo.uid)" hover-class="common-hover" :hover-stay-time="50">
  234. <view class="icon"><image class="icon-img" src="/static/img/img30.png" mode="aspectFit"></image></view>
  235. <text>邀请有礼</text>
  236. </view>
  237. <view class="order-item" @click="navTo('/pages/coupon/coupon')" hover-class="common-hover" :hover-stay-time="50">
  238. <view class="icon"><image class="icon-img" src="/static/img/img28.png" mode="aspectFit"></image></view>
  239. <text>我的卡包</text>
  240. </view>
  241. </view>
  242. </view>
  243. <view class="item-box">
  244. <view class="box-title flex">
  245. <view class="title"><text>商城服务</text></view>
  246. </view>
  247. <view class="order-section">
  248. <view class="order-item" @click="navTo('/pages/commission/commission')" hover-class="common-hover" :hover-stay-time="50">
  249. <view class="icon"><image class="icon-img" src="/static/img/img59.png" mode="aspectFit"></image></view>
  250. <text>我的钱包</text>
  251. </view>
  252. <view class="order-item" @click="navTo('/pages/address/address')" hover-class="common-hover" :hover-stay-time="50">
  253. <view class="icon"><image class="icon-img" src="/static/img/img29.png" mode="aspectFit"></image></view>
  254. <text>商城地址</text>
  255. </view>
  256. <view class="order-item" @click="navTo('/pages/service/service')" hover-class="common-hover" :hover-stay-time="50">
  257. <view class="icon"><image class="icon-img" src="/static/img/img31.png" mode="aspectFit"></image></view>
  258. <text>客服与帮助</text>
  259. </view>
  260. <view class="order-item" @click="navTo('/pages/set/set')" hover-class="common-hover" :hover-stay-time="50">
  261. <view class="icon"><image class="icon-img" src="/static/img/img32.png" mode="aspectFit"></image></view>
  262. <text>设置</text>
  263. </view>
  264. </view>
  265. </view>
  266. </view>
  267. </scroll-view>
  268. <view class="guess-name" v-if="userInfo != '' && Guesslist != ''">
  269. <view class="img"><image src="../../static/img/img13.png"></image></view>
  270. <view class="name">猜你喜欢</view>
  271. </view>
  272. <view id="list-box" class="list-box" :style="{ height: swiperHeight + 'px' }">
  273. <view class="guess-section">
  274. <view v-for="(item, index) in Guesslist" :key="index" class="guess-item" @click="ToDetail(item)">
  275. <view class="imagewrapper"><image :src="item.image"></image></view>
  276. <view class="guess-list">
  277. <text class="title clamp margin-c-20">{{ item.store_name }}</text>
  278. <view class="info clamp margin-c-20">{{ item.store_info }}</view>
  279. <view class="tipBox margin-c-20">
  280. <view class="tipsl" v-if="item.keyword != ''">
  281. <text v-for="lss in item.keyword">{{ lss }}</text>
  282. </view>
  283. </view>
  284. </view>
  285. <view class="price margin-c-20 flex">
  286. <view class="price_list">
  287. <view class="price-red">
  288. ¥{{ item.price }}
  289. <text>/份</text>
  290. </view>
  291. <view class="price-green">
  292. ¥{{ item.ot_price }}
  293. <text>市场价</text>
  294. </view>
  295. </view>
  296. <view class="img position-relative" @click.stop="Addcar(item)">
  297. <image src="/static/img/img21.png"></image>
  298. <view class="corner" v-if="item.cart_num > 0">
  299. <text>{{ item.cart_num }}</text>
  300. </view>
  301. </view>
  302. </view>
  303. </view>
  304. </view>
  305. </view>
  306. <!-- <view class="bottom-show">
  307. <view class="show-left">
  308. 关注公众号,及时接收订单消息提醒
  309. </view>
  310. <view class="show-right">
  311. 点击关注
  312. </view>
  313. </view> -->
  314. </view>
  315. </template>
  316. <script>
  317. import { mapState, mapMutations } from 'vuex';
  318. import uniList from '@/components/uni-list/uni-list.vue';
  319. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  320. import { article, details } from '@/api/notice.js';
  321. import { orderData } from '@/api/user.js';
  322. import { getUserInfo } from '@/api/login.js';
  323. import { getProducts, cartAdd, pinkT_list } from '@/api/product.js';
  324. import store from '@/store/index.js';
  325. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  326. let startY = 0,
  327. moveY = 0,
  328. pageAtTop = true;
  329. export default {
  330. components: {
  331. uniList,
  332. uniListItem
  333. },
  334. data() {
  335. return {
  336. orderInfo: {
  337. complete_count: 0,
  338. received_count: 0,
  339. unshipped_count: 0,
  340. order_count: 0
  341. },
  342. text: '美卡权益大升级,加入美卡,即享4大权益',
  343. coverTransform: 'translateY(0px)',
  344. coverTransition: '0s',
  345. moving: false,
  346. grade: '',
  347. Guesslist: '',
  348. swiperHeight: '',
  349. userInfo:'',
  350. image: '', //海报图片
  351. cid: 4, //文章分类
  352. pinkList: [], // 拼团列表
  353. pinkContent: {}, // 拼团信息
  354. };
  355. },
  356. onShow() {
  357. // 判断是否已经登录
  358. if (this.hasLogin) {
  359. this.loadBaseData();
  360. this.ArticleDate();
  361. }else{
  362. this.userInfo = ''
  363. }
  364. // 加载猜你喜欢
  365. this.Guess();
  366. },
  367. onLoad(option) {
  368. if (option.spread) {
  369. uni.setStorageSync('spread', option.spread);
  370. }
  371. saveUrl();
  372. },
  373. watch: {
  374. // 初次加载页面高度时修改页面高度
  375. Guesslist(newValue, oldValue) {
  376. let obj = this;
  377. let bHeight = Math.ceil(newValue.length / 2);
  378. obj.$nextTick(function() {
  379. uni.createSelectorQuery()
  380. .select('#list-box')
  381. .fields(
  382. {
  383. size: true
  384. },
  385. function(data) {
  386. obj.pageProportion = data.width / 750;
  387. obj.swiperHeight = Math.ceil(obj.pageProportion * 580 * bHeight);
  388. }
  389. )
  390. .exec();
  391. });
  392. }
  393. },
  394. computed: {
  395. ...mapState('user',['hasLogin'])
  396. },
  397. methods: {
  398. ...mapMutations('user',['setUserInfo', 'setOrderInfo']),
  399. // 加载初始数据
  400. loadBaseData() {
  401. let obj = this;
  402. getUserInfo({}).then(({ data }) => {
  403. obj.userInfo = data;
  404. obj.setUserInfo(data);
  405. if(data.level_info == null){
  406. obj.grade = 0
  407. }else{
  408. obj.grade = data.level_info.grade;
  409. }
  410. orderData({})
  411. .then(({ data }) => {
  412. obj.orderInfo = data;
  413. })
  414. .catch(e => {
  415. // if(e.message=='请选择配送地址'){
  416. // uni.showModal({
  417. // title: "您尚未定位是否马上定位?",
  418. // success: (e) => {
  419. // if (e.confirm) {
  420. // //修改地址为可查看
  421. // store.commit('upAddressPageShow');
  422. // uni.navigateTo({
  423. // url:'/pages/index/address'
  424. // })
  425. // }
  426. // }
  427. // })
  428. // }
  429. obj.orderinfo = {};
  430. });
  431. }).catch((e) => {
  432. console.log(e)
  433. });
  434. // 获取拼团列表
  435. pinkT_list({
  436. page: 1,
  437. limit: 10,
  438. type: 1
  439. }).then(({data}) => {
  440. this.pinkList = data;
  441. this.pinkContent = data[0];
  442. })
  443. },
  444. // #ifdef MP
  445. onShareAppMessage: function(res) {
  446. let userInfo = uni.getStorageSync('userInfo');
  447. let GetInfo = uni.getStorageSync('GetInfo');
  448. // 来自页面内分享按钮
  449. let pages = getCurrentPages();
  450. // 获取当前页面
  451. let page = pages[pages.length - 1];
  452. let path = '/pages/user/user?';
  453. // 保存邀请人
  454. path += 'spread=' + userInfo.uid;
  455. let data = {
  456. path: path,
  457. imageUrl: GetInfo.img,
  458. title: GetInfo.title
  459. };
  460. console.log(data)
  461. return data;
  462. },
  463. // #endif
  464. toDaibiao(item){
  465. let id = item;
  466. console.log(this.userInfo,88)
  467. if(this.userInfo.is_promoter == 1){
  468. if(id == 1){
  469. // 推广订单
  470. uni.navigateTo({
  471. url: `/pages/commission/order`
  472. });
  473. }
  474. if(id == 2){
  475. // 我的团队
  476. uni.navigateTo({
  477. url: `/pages/team/team`
  478. });
  479. }
  480. if(id == 5){
  481. // 接龙
  482. uni.navigateTo({
  483. url: `/pages/groupBooking/klondike`
  484. });
  485. }
  486. // if(id == 3){
  487. // uni.navigateTo({
  488. // url: `/pages/commission/order`
  489. // });
  490. // }
  491. }else{
  492. uni.showToast({
  493. title: '点击申请代表查询如何成为代表,赚取佣金!',
  494. type: 'top',
  495. duration: 5000,
  496. icon: 'none'
  497. })
  498. }
  499. },
  500. //菜佬优惠日
  501. async ArticleDate() {
  502. let obj = this;
  503. article({}, obj.cid).then(function({ data }) {
  504. obj.image = data[0].image_input[0];
  505. console.log(obj.image)
  506. });
  507. },
  508. // 猜你喜欢
  509. Guess() {
  510. let obj = this;
  511. getProducts({
  512. page: 1,
  513. limit: 10,
  514. type: 1,
  515. sid: 98 //分类id
  516. })
  517. .then(({ data }) => {
  518. obj.Guesslist = data;
  519. })
  520. .catch(err => {
  521. console.log(err);
  522. });
  523. },
  524. // 商品详情页
  525. ToDetail(item) {
  526. if (item.stock < 1) {
  527. this.$api.msg('该商品已售罄');
  528. } else {
  529. uni.navigateTo({
  530. url: `/pages/product/product?id=` + item.id
  531. });
  532. }
  533. },
  534. // 查看拼团详情
  535. GoPinkdetails() {
  536. uni.navigateTo({
  537. url: '/pages/order/order?state=1'
  538. });
  539. // uni.navigateTo({
  540. // url: '/pages/groupBooking/groupdetails?id=' + this.pinkContent.pink_id + '&order_id=' + this.pinkContent.order_id
  541. // });
  542. },
  543. Tomember() {
  544. uni.showToast({
  545. title: '暂未开通!',
  546. type: 'top',
  547. duration: 500,
  548. icon: 'none'
  549. })
  550. },
  551. //加入购物车
  552. Addcar(item) {
  553. let obj = this;
  554. cartAdd({
  555. cartNum: '1', //商品数量
  556. uniqueId: '', //商品标签
  557. new: 0, //商品是否新增加到购物车1为不加入0为加入
  558. mer_id: '',
  559. productId: item.id //商品编号
  560. })
  561. .then(function(e) {
  562. uni.showToast({
  563. title: '成功加入购物车',
  564. type: 'top',
  565. duration: 500,
  566. icon: 'none'
  567. });
  568. obj.Guess();
  569. })
  570. .catch(e => {});
  571. },
  572. /**
  573. * 统一跳转接口,拦截未登录路由
  574. * navigator标签现在默认没有转场动画,所以用view
  575. */
  576. navTo(url) {
  577. if (!this.hasLogin) {
  578. // 保存地址
  579. saveUrl();
  580. // 登录拦截
  581. interceptor();
  582. } else {
  583. uni.navigateTo({
  584. url
  585. });
  586. }
  587. }
  588. }
  589. };
  590. </script>
  591. <style lang="scss">
  592. .bottom-show{
  593. width:750rpx;
  594. height:67rpx;
  595. background:rgba(147,147,147,1);
  596. position: fixed;
  597. bottom: 50px;
  598. left: 0;
  599. display: flex;
  600. z-index: 2000;
  601. justify-content: space-between;
  602. align-items: center;
  603. padding: 0 20rpx;
  604. .show-left{
  605. font-size:26rpx;
  606. font-weight:400;
  607. color:rgba(255,255,255,1);
  608. }
  609. .show-right{
  610. padding: 6rpx 23rpx ;
  611. font-size:24rpx;
  612. font-weight:400;
  613. color:rgba(255,255,255,1);
  614. background:linear-gradient(90deg,rgba(255,55,0,1) 0%,rgba(255,0,0,1) 100%);
  615. border-radius:22rpx;
  616. }
  617. }
  618. page {
  619. height: 100%;
  620. }
  621. %flex-center {
  622. display: flex;
  623. flex-direction: column;
  624. justify-content: center;
  625. align-items: center;
  626. }
  627. %section {
  628. display: flex;
  629. justify-content: space-around;
  630. align-content: center;
  631. background: #fff;
  632. border-radius: 10rpx;
  633. }
  634. .container {
  635. background-color: $page-color-base;
  636. padding-bottom: 160rpx;
  637. }
  638. .content-box {
  639. height: 100%;
  640. }
  641. .user-section {
  642. height: 350rpx;
  643. padding: 15rpx 30rpx 0;
  644. position: relative;
  645. .bg {
  646. position: absolute;
  647. left: 0;
  648. top: 0;
  649. width: 100%;
  650. height: 100%;
  651. background-color: #33CA69;
  652. }
  653. }
  654. .user-info-box {
  655. height: 200rpx;
  656. color: white;
  657. display: flex;
  658. align-items: center;
  659. justify-content: space-between;
  660. position: relative;
  661. z-index: 1;
  662. .detail {
  663. height: 130rpx;
  664. .portrait-box {
  665. height: 100%;
  666. .portrait {
  667. width: 130rpx;
  668. height: 100%;
  669. border: 5rpx solid #fff;
  670. border-radius: 50%;
  671. }
  672. }
  673. .info-box {
  674. margin-left: 20rpx;
  675. line-height: 1.5;
  676. .username {
  677. font-size: $font-lg + 6rpx;
  678. height: 100%;
  679. .user-name{
  680. max-width: 330rpx;
  681. }
  682. .image{
  683. margin-left: 15rpx;
  684. width: 106rpx;
  685. height: 32rpx;
  686. image{
  687. width: 100%;
  688. height: 100%;
  689. }
  690. }
  691. }
  692. .member {
  693. padding: 5rpx 0rpx;
  694. position: relative;
  695. .img {
  696. position: absolute;
  697. top: 22rpx;
  698. left: 20rpx;
  699. width: 25rpx;
  700. height: 20rpx;
  701. image{
  702. width: 100%;
  703. height: 100%;
  704. }
  705. }
  706. .grade {
  707. padding-left: 10rpx;
  708. background: #35383f;
  709. font-size: 24rpx;
  710. padding: 6rpx 15rpx;
  711. padding-left: 50rpx !important;
  712. padding-right: 25rpx !important;
  713. border: 2rpx solid #feeeb6;
  714. color: #F3D184;
  715. border-radius: 25rpx;
  716. max-width: 280rpx;
  717. min-width: 150rpx;
  718. }
  719. }
  720. .phone{
  721. padding-top: 10rpx;
  722. font-size: 26rpx;
  723. }
  724. }
  725. }
  726. .config {
  727. font-size: 58rpx;
  728. height: 130rpx;
  729. padding-top: 25rpx;
  730. }
  731. }
  732. .notice-box {
  733. .notice-bar {
  734. background: linear-gradient(left, rgba(249,230,191,1), rgba(252,187,140,1));
  735. }
  736. display: flex;
  737. flex-direction: column;
  738. color: #f7d680;
  739. border-radius: 25rpx 25rpx 0 0;
  740. overflow: hidden;
  741. position: relative;
  742. height: 65rpx;
  743. font-size: 22rpx;
  744. color: #84592f;
  745. }
  746. .card-box-list{
  747. color: #000000;
  748. padding: 20rpx 50rpx;
  749. border-radius: 15rpx;
  750. position: absolute;
  751. z-index: 200;
  752. top:220rpx;
  753. background-color: #FFFFFF;
  754. left: 35rpx;
  755. width:92%;
  756. .fenge{
  757. width:2rpx;
  758. height:79rpx;
  759. background:rgba(208,210,209,1);
  760. }
  761. .coupon-list{
  762. .number{
  763. font-size: 49rpx;
  764. font-weight: bolder;
  765. .text{
  766. padding-left: 15rpx;
  767. font-size: 26rpx !important;
  768. font-weight: normal;
  769. }
  770. }
  771. .name{
  772. font-size: 24rpx !important;
  773. padding-top: 10rpx;
  774. }
  775. }
  776. }
  777. .vip-card-box {
  778. display: flex;
  779. flex-direction: column;
  780. color: #f7d680;
  781. height: 240rpx;
  782. border-radius: 25rpx 25rpx 0 0;
  783. overflow: hidden;
  784. position: relative;
  785. z-index: 9;
  786. margin-top: -20rpx;
  787. // background-image: url(../../static/img/img11.png);
  788. // background-size: 100% 100%;
  789. .card-img{
  790. width: 100%;
  791. height: 300rpx;
  792. image{
  793. width: 100%;
  794. height: 100%;
  795. }
  796. }
  797. .card-bg {
  798. position: absolute;
  799. top: 20rpx;
  800. right: 0;
  801. width: 380rpx;
  802. height: 260rpx;
  803. }
  804. .b-btn {
  805. position: absolute;
  806. right: 20rpx;
  807. top: 23rpx;
  808. text-align: center;
  809. font-size: 22rpx;
  810. color: #494347;
  811. padding: 6rpx 15rpx 6rpx 25rpx;
  812. border-radius: 20px;
  813. background: #f2d18a;
  814. z-index: 1;
  815. .iconfont{
  816. font-size: 22rpx;
  817. }
  818. }
  819. .tit {
  820. position: absolute;
  821. margin: 15rpx 25rpx;
  822. z-index: 999;
  823. font-size: 32rpx;
  824. padding-top: 10rpx;
  825. .img {
  826. width: 32rpx;
  827. height: 29rpx;
  828. image {
  829. width: 100%;
  830. height: 100%;
  831. }
  832. }
  833. .tpl {
  834. font-size: 24rpx;
  835. font-style: normal;
  836. padding-left: 15rpx;
  837. color: #f3d184;
  838. }
  839. .iconfont {
  840. color: #f6e5a3;
  841. margin-right: 16rpx;
  842. font-size: 28rpx !important;
  843. }
  844. }
  845. .e-b {
  846. font-size: $font-sm;
  847. color: #d8cba9;
  848. margin-top: 10rpx;
  849. }
  850. }
  851. .cover-container {
  852. background: $page-color-base;
  853. padding: 0 30rpx;
  854. position: relative;
  855. background: #f5f5f5;
  856. padding-bottom: 20rpx;
  857. z-index: 99;
  858. padding-top: 10rpx;
  859. .arc {
  860. position: absolute;
  861. left: 0;
  862. top: -34rpx;
  863. width: 100%;
  864. height: 36rpx;
  865. }
  866. }
  867. .arc-image{
  868. width: 100%;
  869. margin: 25rpx 0;
  870. text-align: center;
  871. height: auto;
  872. image{
  873. width: 100%;
  874. height: auto;
  875. }
  876. }
  877. .item-box {
  878. border-radius: 10rpx;
  879. background-color: white;
  880. // margin-top: 20rpx;
  881. margin: 20rpx 0;
  882. .box-title {
  883. line-height: 1;
  884. padding: 30rpx;
  885. .title {
  886. font-size: $font-lg;
  887. font-weight: bold;
  888. }
  889. .link {
  890. font-size: $font-base - 2rpx;
  891. color: $font-color-light;
  892. }
  893. }
  894. .lastSection {
  895. display: flex;
  896. align-items: 0;
  897. justify-content: flex-start;
  898. margin-left: 2%;
  899. }
  900. .order-section {
  901. @extend %section;
  902. padding: 28rpx 0;
  903. .order-item {
  904. @extend %flex-center;
  905. width: 150rpx;
  906. height: 120rpx;
  907. border-radius: 10rpx;
  908. font-size: $font-sm;
  909. color: #697079;
  910. .order-text{
  911. font-size:26rpx;
  912. font-weight:500;
  913. color:rgba(26,32,60,1);
  914. }
  915. }
  916. .iconfont {
  917. font-size: 48rpx;
  918. margin-bottom: 18rpx;
  919. color: #fa436a;
  920. }
  921. .icon-shouhoutuikuan {
  922. font-size: 44rpx;
  923. }
  924. .icon {
  925. height: 62rpx;
  926. width: 62rpx;
  927. margin-bottom: 18rpx;
  928. background-size: 100%;
  929. background-repeat: no-repeat;
  930. background-position: center;
  931. .icon-img {
  932. width: 100%;
  933. height: 100%;
  934. }
  935. }
  936. }
  937. .group-order{
  938. width: 100%;
  939. height: 150rpx;
  940. padding: 0rpx 25rpx;
  941. padding-bottom: 25rpx !important;
  942. .group-order-list{
  943. width: 100%;
  944. height: 100%;
  945. background-color: #F7F9F8;
  946. border-radius: 10rpx;
  947. padding: 0rpx 25rpx;
  948. font-size: 26rpx;
  949. .list-img-box{
  950. width: 73%;
  951. image{
  952. width:100rpx;
  953. height: 100rpx;
  954. }
  955. .info{
  956. width: 75%;
  957. padding-left: 15rpx;
  958. .info-tip{
  959. color: #8F9190;
  960. font-size: 22rpx !important;
  961. padding-top: 10rpx;
  962. }
  963. }
  964. }
  965. .btn-detai{
  966. border: 2rpx solid #D0D2D1;
  967. padding: 8rpx 25rpx;
  968. border-radius: 25rpx;
  969. font-size: 24rpx !important;
  970. }
  971. }
  972. }
  973. }
  974. .history-section {
  975. // padding: 30rpx 0 0;
  976. margin-top: 20rpx;
  977. background: #fff;
  978. border-radius: 10rpx;
  979. .sec-header {
  980. display: flex;
  981. align-items: center;
  982. font-size: $font-base;
  983. color: $font-color-dark;
  984. line-height: 40rpx;
  985. margin-left: 30rpx;
  986. padding-top: 30rpx;
  987. .iconfont {
  988. font-size: 28rpx;
  989. color: $color-red;
  990. margin-right: 16rpx;
  991. line-height: 40rpx;
  992. }
  993. }
  994. .h-list {
  995. white-space: nowrap;
  996. padding: 30rpx 30rpx 0;
  997. .h-list-image {
  998. display: inline-block;
  999. width: 160rpx;
  1000. height: 160rpx;
  1001. margin-right: 20rpx;
  1002. border-radius: 10rpx;
  1003. }
  1004. }
  1005. }
  1006. .guess-name {
  1007. padding: 25rpx 25rpx;
  1008. font-size: 32rpx;
  1009. text-align: center;
  1010. .img{
  1011. width: 80%;
  1012. margin: 0rpx auto;
  1013. height: 4rpx;
  1014. image{
  1015. width: 100%;
  1016. height: 100%;
  1017. }
  1018. }
  1019. }
  1020. /* 猜你喜欢 */
  1021. .guess-section {
  1022. display: flex;
  1023. flex-wrap: wrap;
  1024. padding: 0 20rpx;
  1025. .guess-item {
  1026. // height: 558rpx;
  1027. position: relative;
  1028. overflow: hidden;
  1029. display: flex;
  1030. flex-direction: column;
  1031. border: 2rpx solid #eeeeee;
  1032. width: 343rpx;
  1033. margin-bottom: 4%;
  1034. border-radius: $border-radius-sm;
  1035. background-color: white;
  1036. padding-bottom: 30rpx;
  1037. &:nth-child(2n + 1) {
  1038. margin-right: 24rpx;
  1039. }
  1040. }
  1041. .imagewrapper {
  1042. width: 100%;
  1043. height: 330rpx;
  1044. border-radius: 3px;
  1045. margin-bottom: 15rpx;
  1046. image {
  1047. width: 100%;
  1048. height: 100%;
  1049. // opacity: 1;
  1050. }
  1051. }
  1052. .guess-list{
  1053. height: 130rpx;
  1054. .title {
  1055. font-size: 28rpx;
  1056. color: $font-color-dark;
  1057. }
  1058. .info {
  1059. color: #999999;
  1060. font-size: 24rpx;
  1061. }
  1062. .tipBox{
  1063. // padding-bottom: 8rpx;
  1064. .tipsl {
  1065. text {
  1066. border: 2rpx solid #ff1a27;
  1067. color: #ff1a27;
  1068. border-radius: 5rpx;
  1069. font-size: 18rpx;
  1070. padding: 2rpx 5rpx;
  1071. margin-right: 15rpx;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. .price {
  1077. font-size: 28rpx;
  1078. width: 303rpx;
  1079. // padding-top: 25rpx;
  1080. position: relative;
  1081. .price_list {
  1082. .price-red {
  1083. font-weight: bold;
  1084. font-size: 32rpx !important;
  1085. color:#FF1A27;
  1086. text {
  1087. color: #9699a0;
  1088. font-size: 24rpx !important;
  1089. font-weight: normal;
  1090. padding: 0rpx 10rpx;
  1091. }
  1092. }
  1093. .price-green {
  1094. color: #2dbd59;
  1095. font-size: 24rpx !important;
  1096. text {
  1097. background: #2dbd59;
  1098. color: #ffffff;
  1099. padding: 0rpx 8
  1100. rpx;
  1101. border-radius: 7rpx;
  1102. font-size: 20rpx !important;
  1103. margin-left: 8rpx;
  1104. }
  1105. }
  1106. }
  1107. .img {
  1108. position: absolute;
  1109. bottom: 0;
  1110. right: 0;
  1111. width: 50rpx;
  1112. height: 50rpx;
  1113. image {
  1114. width: 100%;
  1115. height: 100%;
  1116. }
  1117. }
  1118. }
  1119. .icon {
  1120. @extend %icon;
  1121. }
  1122. .detail {
  1123. line-height: 1;
  1124. }
  1125. .tip {
  1126. color: white;
  1127. background-color: $color-yellow;
  1128. line-height: 1.5;
  1129. font-size: $font-sm;
  1130. padding-left: 20rpx;
  1131. }
  1132. }
  1133. /*公用边框样式*/
  1134. %icon {
  1135. margin-right: 10rpx;
  1136. display: inline-block;
  1137. padding: 2rpx 10rpx;
  1138. border: 1rpx solid $color-yellow;
  1139. color: $color-yellow;
  1140. line-height: 1;
  1141. font-size: $font-base;
  1142. border-radius: 10rpx;
  1143. }
  1144. </style>