index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519
  1. <template>
  2. <view class="container">
  3. <!-- <view class="navbar"> -->
  4. <navbar ref="navbar" :config="config" backColor="#666">
  5. </navbar>
  6. <!-- </view> -->
  7. <!-- <顶部> -->
  8. <view class="top">
  9. <!-- <背景图>$mConfig.staticUrl http://192.168.0.119/ycimg -->
  10. <!-- <image :src="imgUrl + '/my-top-bgImg.png'"></image> -->
  11. <!-- <image src="http://192.168.0.119/ycimg/my-top-bgImg.png"></image> -->
  12. <view class="bgImg">
  13. <!-- <image :src="imgUrl+'/my-list-bgImg.png'"></image> -->
  14. <view class="position-ab">
  15. <!-- <view class="top-data-box2">
  16. <view class="item" @click="tabPage('/pages/signCenter/index',true)">
  17. <view>
  18. <view class="title">每日签到</view>
  19. <view class="tip">签到得爱心</view>
  20. </view>
  21. <view class="icon" :class="isSign?'active':''">
  22. <text class="iconfont2">&#xe60d;</text>
  23. </view>
  24. </view>
  25. <view class="line"></view>
  26. <view class="item" @click="tabPage('/pages/operationCenter/index',true)">
  27. <view>
  28. <view class="title">推广明细</view>
  29. <view class="tip">推广赚零钱</view>
  30. </view>
  31. <view class="icon">
  32. <text class="iconfont2" style="font-size: 32rpx;">&#xe684;</text>
  33. </view>
  34. </view>
  35. <view class="line"></view>
  36. <view class="item" @click="tabPage('/pages/couponCenter/index')">
  37. <view>
  38. <view class="title">领券中心</view>
  39. <view class="tip">领取得福利</view>
  40. </view>
  41. <view class="icon">
  42. <text class="iconfont2" style="font-size: 34rpx;">&#xe8c0;</text>
  43. </view>
  44. </view>
  45. </view> -->
  46. <view class="middle">
  47. <view class="middle-top">
  48. <view style="display: flex;justify-content: space-between;width: 300rpx;">
  49. <view class="order" v-for="(item,index) in orderTypeList" :key="index"
  50. :class="orderTypeIndex==index?'active':''" @click="orderTypeIndex=index;getGeneralOrderCount()">
  51. {{item.text}}
  52. </view>
  53. </view>
  54. <view class="whole" @click="linkOrderList(-1)">
  55. <view class="whole-top">
  56. 查看全部
  57. </view>
  58. <view class="iconfont wholeright">&#xe6c7;</view>
  59. </view>
  60. </view>
  61. <view class="middle-content">
  62. <view class="list" @click="linkOrderList(0)">
  63. <view class="anglenum" v-if="generalOrder.waitPayNum=='0'?false:generalOrder.waitPayNum">
  64. {{generalOrder.waitPayNum}}
  65. </view>
  66. <text class="iconfont one">&#xe697;</text>
  67. <view class="name-one">
  68. 待付款
  69. </view>
  70. </view>
  71. <view class="list" @click="linkOrderList(1)">
  72. <view class="anglenum" v-if="generalOrder.waitShipNum=='0'?false:generalOrder.waitShipNum">
  73. {{generalOrder.waitShipNum}}
  74. </view>
  75. <!-- <text class=" iconfont two">&#xe621;</text> -->
  76. <image class="my-icon" src="/static/order/seed-goods.png"></image>
  77. <view class="name-one">待发货 </view>
  78. </view>
  79. <view class="list" @click="linkOrderList(3)">
  80. <view class="anglenum" v-if="generalOrder.waitReceivingNum=='0'?false:generalOrder.waitReceivingNum">
  81. {{generalOrder.waitReceivingNum}}
  82. </view>
  83. <text class="iconfont three">&#xe63f;</text>
  84. <view class="name-one">待收货 </view>
  85. </view>
  86. <view class="list" @click="linkOrderList(5)">
  87. <view class="anglenum" v-if="generalOrder.waitCommentNum=='0'?false:generalOrder.waitCommentNum">
  88. {{generalOrder.waitCommentNum}}
  89. </view>
  90. <!-- <text class="iconfont four">&#xe61b;</text> -->
  91. <!-- <image class="my-icon" :src="imgUrl+'/login/noevaluate.png'"></image> -->
  92. <image class="my-icon" src="/static/order/estimate.png"></image>
  93. <view class="name-one">待评价 </view>
  94. </view>
  95. <view class="list" @click="linkOrderList(6)">
  96. <!-- <view class="anglenum">1</view> -->
  97. <text class="iconfont five">&#xe9ae;</text>
  98. <view class="name-one">退换/售后 </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="other" v-if="false">
  103. <view class="other-top" @click="linkServiceOrderList(-1)">
  104. <view class="left">
  105. 服务订单
  106. </view>
  107. <view class="right">
  108. 查看全部<text class="iconfont"
  109. style="color: #999999; margin-left: 16rpx; font-size: 35rpx;margin-top: 0;">&#xe6c7;</text>
  110. </view>
  111. </view>
  112. <view class="option">
  113. <view class="list" @click="linkServiceOrderList(0)">
  114. <view class="othernum" v-if="serviceOrder.waitPayNum=='0'?false:serviceOrder.waitPayNum">
  115. {{serviceOrder.waitPayNum}}
  116. </view>
  117. <text class="iconfont one">&#xe697;</text>
  118. <view class="name-one">待付款</view>
  119. </view>
  120. <view class="list" @click="linkServiceOrderList(3)">
  121. <view class="othernum" v-if="serviceOrder.waitUseNum=='0'?false:serviceOrder.waitUseNum">
  122. {{serviceOrder.waitUseNum}}
  123. </view>
  124. <!-- <text class=" iconfont two">&#xe621;</text> -->
  125. <image class="my-icon" :src="imgUrl+'/login/nouse.png'"></image>
  126. <view class="name-one">待使用 </view>
  127. </view>
  128. <view class="list" @click="linkServiceOrderList(5)">
  129. <view class="othernum" v-if="serviceOrder.waitCommentNum=='0'?false:serviceOrder.waitCommentNum">
  130. {{serviceOrder.waitCommentNum}}
  131. </view>
  132. <!-- <text class="iconfont four">&#xe61b;</text> -->
  133. <image class="my-icon" :src="imgUrl+'/login/noevaluate.png'"></image>
  134. <view class="name-one">待评价 </view>
  135. </view>
  136. <view class="list" @click="linkServiceOrderList(6)">
  137. <!-- <view class="othernum">1</view> -->
  138. <text class="iconfont five">&#xe9ae;</text>
  139. <view class="name-one">轻松退 </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. <view class="position-ab">
  145. <view class="other">
  146. <view class="other-top" @click="affiliateMerchantOrderList">
  147. <view class="left">联盟商家订单</view>
  148. <view class="right">
  149. 查看全部<text class="iconfont"
  150. style="color: #999999; margin-left: 16rpx; font-size: 35rpx;margin-top: 0;">&#xe6c7;</text>
  151. </view>
  152. </view>
  153. <view class="order-info">
  154. <view class="item">
  155. <view class="num">{{affiliateMerchantOrderInfo.order_num || 0}}</view>
  156. <view class="">订单数</view>
  157. </view>
  158. <view class="item">
  159. <view class="num">{{affiliateMerchantOrderInfo.sale_money_total || 0}}</view>
  160. <view class="">消费金额(¥)</view>
  161. </view>
  162. <view class="item">
  163. <view class="num">{{affiliateMerchantOrderInfo.discount_money_total || 0}}</view>
  164. <view class="">打赏金额(¥)</view>
  165. </view>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <!-- 猜你喜欢 -->
  171. <view class="guess">
  172. <view class="guess-top">
  173. <view class="guess-left">猜你喜欢</view>
  174. <view class="guess-line"></view>
  175. <view class="guess-right">智能推荐你感兴趣的优品</view>
  176. </view>
  177. <view class="guess-item" v-if="goodsList && goodsList.length > 0">
  178. <view class="item" @click="goProductDetails('/pages/product/goods/goods?id=' + item.id)"
  179. v-for="(item, index) in goodsList" :key="index">
  180. <image v-if="item && item.cover" :src="item.cover" mode="aspectFill"></image>
  181. <view style=" padding-bottom: 40rpx;">
  182. <view class="name" style="flex: 1;">{{ item.title }}</view>
  183. <view class="number">
  184. <view class="number-red">
  185. <rich-text :nodes="$mUtil.priceBigSmall(item.min_sale_price)"></rich-text>
  186. </view>
  187. <view class="number-grey">¥{{ item.max_market_price }}</view>
  188. </view>
  189. </view>
  190. </view>
  191. </view>
  192. <nodata v-else :config="{ top: 1, content: '暂无商品~' }"></nodata>
  193. <loadMore v-if="goodsList.length > 0" :status="status"></loadMore>
  194. </view>
  195. <!-- 猜你喜欢 -->
  196. </view>
  197. </view>
  198. </template>
  199. <script>
  200. import {
  201. myInfo,
  202. getAccountInfo
  203. } from "@/api/login.js"
  204. import {
  205. myStatistics,
  206. unreadNum
  207. } from "@/api/userInfo.js"
  208. let app = getApp()
  209. export default {
  210. data() {
  211. return {
  212. config: {
  213. back: false, //false是tolbar页面 是则不写
  214. title: '订单',
  215. color: '#1a1a1a',
  216. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  217. // backgroundColor: [0, '#2cba28'],
  218. rightSlot: true,
  219. },
  220. imgUrl: this.$mConfig.staticUrl,
  221. //微信小程序用户信息
  222. userInfo: {
  223. head_photo: "",
  224. nickname: "登录/注册"
  225. },
  226. hiddenLink: true,
  227. loginNo: false, //判断显示邀请码
  228. storage: true,
  229. isLogin: false, //判断是否登录
  230. userInformation: {}, //用户信息
  231. myCommunity: {}, //我的社区
  232. myMsg: null,
  233. //服务订单数量
  234. serviceOrder: {
  235. waitPayNum: "0", //待支付数量
  236. waitCommentNum: "0", //待评论数量
  237. waitUseNum: "0" //待使用数量
  238. },
  239. //服务订单数量
  240. generalOrder: {
  241. waitPayNum: "0", //待支付数量
  242. waitCommentNum: "0", //待评论数量
  243. waitUseNum: "0", //待使用数量
  244. waitShipNum: "0", //待发货数量
  245. waitReceivingNum: "0" //待收货数量
  246. },
  247. ispay: app.globalData.openPay,
  248. topData: [{
  249. title: '我的爱心',
  250. value: '0'
  251. }, {
  252. title: '今日爱心',
  253. value: '0'
  254. }, {
  255. title: '公益积分',
  256. value: '0'
  257. }, {
  258. title: '优惠券',
  259. value: '0'
  260. }],
  261. numObj: {},
  262. //value对应订单列表接口的area_feature参数。传0或不传是排除了申购的订单列表(商品订单),传3是申购订单列表
  263. orderTypeList: [{
  264. text: '商品订单',
  265. value: 0
  266. },
  267. // {
  268. // text: '申领订单',
  269. // value: 3
  270. // },
  271. ],
  272. orderTypeIndex: 0,
  273. isSign: false, // 是否签到
  274. goodsList: [],
  275. page: 1,
  276. status: 'more',
  277. affiliateMerchantOrderInfo: {}
  278. }
  279. },
  280. created() {
  281. let userInfo = uni.getStorageSync("apiToken")
  282. let shop = uni.getStorageSync("shop")
  283. },
  284. onReachBottom() {
  285. if (this.status == 'more') {
  286. this.page++;
  287. this.guessLike();
  288. if (this.isLogin) {
  289. this.getGeneralOrderCount()
  290. }
  291. }
  292. // this.status = "loading";
  293. },
  294. onPageScroll(e) {
  295. let maxHeight = uni.upx2px(300);
  296. if (e.scrollTop > maxHeight) {
  297. // this.$set(this.config, 'backgroundColor', [1, '#2cba28']);
  298. } else {
  299. // this.$set(this.config, 'backgroundColor', [e.scrollTop / maxHeight.toFixed(1), '#2cba28']);
  300. }
  301. // this.$refs.navbar.init();
  302. },
  303. //清空数据
  304. //显示弹出框
  305. async onShow() {
  306. var that = this
  307. let token = uni.getStorageSync("apiToken")
  308. let shop = uni.getStorageSync("shop")
  309. this.guessLike();
  310. // let personal = uni.getStorageSync("personal")
  311. await this.judgeLogin()
  312. .catch(err => {
  313. /**
  314. * @description 重置数据
  315. */
  316. this.isLogin = false;
  317. this.userInformation = {}; //用户信息
  318. //服务订单数量
  319. this.serviceOrder = {
  320. waitPayNum: "0", //待支付数量
  321. waitCommentNum: "0", //待评论数量
  322. waitUseNum: "0" //待使用数量
  323. },
  324. //服务订单数量
  325. this.generalOrder = {
  326. waitPayNum: "0", //待支付数量
  327. waitCommentNum: "0", //待评论数量
  328. waitUseNum: "0", //待使用数量
  329. waitShipNum: "0", //待发货数量
  330. waitReceivingNum: "0" //待收货数量
  331. }
  332. for (let i in this.topData) {
  333. this.topData[i].value = 0;
  334. }
  335. this.isSign = false;
  336. })
  337. // let getWxUserInfo = uni.getStorageSync("wxUserInfo")
  338. // if(getWxUserInfo !=''){
  339. // that.userInfo = JSON.parse(getWxUserInfo)
  340. // }
  341. if (this.isLogin) {
  342. if (token) {
  343. this.hiddenLink = false
  344. this.loginNo = true
  345. this.getuserInfo()
  346. }
  347. await this.getMyStatistics()
  348. // await this.getUnreadNum()
  349. await this.getServiceOrderCount()
  350. await this.getGeneralOrderCount()
  351. await this.getAffiliateMerchantOrder()
  352. this.$forceUpdate();
  353. }
  354. },
  355. onPullDownRefresh() {
  356. let token = uni.getStorageSync("apiToken")
  357. if (!token) {
  358. uni.stopPullDownRefresh();
  359. } else {
  360. this.page = 1;
  361. this.getGeneralOrderCount()
  362. this.guessLike();
  363. this.getAll()
  364. }
  365. },
  366. methods: {
  367. /**猜你喜欢 */
  368. guessLike() {
  369. this.keyWord = uni.getStorageSync("history") ? uni.getStorageSync("history").join(",") : ''
  370. this.$http
  371. .get(
  372. `/goods/smart`, {
  373. page: this.page,
  374. limit: 6,
  375. keywords: this.keyWord,
  376. },
  377. false
  378. )
  379. .then((res) => {
  380. if (res && res.code == 200) {
  381. this.goodsList = this.page == 1 ? res.page.list : this.goodsList.concat(res.page.list);
  382. if (res.page.totalPage <= res.page.currPage) {
  383. this.status = "noMore";
  384. } else {
  385. this.status = "more";
  386. }
  387. }
  388. });
  389. },
  390. // 商品跳转
  391. goProductDetails(url) {
  392. uni.navigateTo({
  393. url: url,
  394. });
  395. },
  396. // 上部切换
  397. topDataChange(e) {
  398. let token = uni.getStorageSync("apiToken")
  399. if (!token) {
  400. uni.navigateTo({
  401. url: "../research/register/login"
  402. })
  403. return;
  404. }
  405. if (e.title == '我的爱心' || e.title == '今日爱心') {
  406. // 跳转 我的爱心
  407. uni.navigateTo({
  408. url: "/pages/research/myLove/index"
  409. })
  410. } else if (e.title == '公益积分') {
  411. // 跳转 我的公益积分
  412. uni.navigateTo({
  413. url: "/pages/research/myPublicWelfare/index"
  414. })
  415. } else if (e.title == '优惠券') {
  416. uni.navigateTo({
  417. url: "/pages/couponCenter/index?isMyCoupon=true"
  418. })
  419. }
  420. },
  421. toolClick(funName) {
  422. if (!funName) {
  423. uni.showToast({
  424. icon: 'none',
  425. title: '暂无功能'
  426. })
  427. return false;
  428. }
  429. this[funName]();
  430. },
  431. rest() {
  432. this.userInformation = {}
  433. this.myCommunity = {}
  434. },
  435. async getAll() {
  436. this.rest() //清空消息
  437. await this.judgeLogin() //判断是否登录
  438. if (this.isLogin) {
  439. // await this.getUnreadNum() //未读消息
  440. await this.getMyStatistics() //登录消息
  441. await this.getuserInfo() //用户消息
  442. this.$forceUpdate();
  443. }
  444. },
  445. //获取未读消息
  446. // getUnreadNum(){
  447. // this.$http.get(unreadNum).then(res=>{
  448. // uni.stopPullDownRefresh();
  449. // if(res&&res.code==200){
  450. // this.myMsg = res.data
  451. // }
  452. // })
  453. // },
  454. //前往我的二维码
  455. jumpcode() {
  456. uni.navigateTo({
  457. url: "../user/invitationCode/invitationCode"
  458. })
  459. },
  460. //前往我的钱包
  461. goToMyWallet() {
  462. let token = uni.getStorageSync("apiToken")
  463. if (!token) {
  464. uni.navigateTo({
  465. url: "../research/register/login"
  466. })
  467. } else {
  468. uni.navigateTo({
  469. url: "../user/wallet/myWallet"
  470. })
  471. }
  472. },
  473. //前往我的积分
  474. goToMyPoints() {
  475. let token = uni.getStorageSync("apiToken")
  476. if (!token) {
  477. uni.navigateTo({
  478. url: "../research/register/login"
  479. })
  480. } else {
  481. uni.navigateTo({
  482. url: "../research/community/mypoints"
  483. })
  484. }
  485. },
  486. getMyStatistics() {
  487. //获取主页数据
  488. this.$http.get(myStatistics)
  489. .then(res => {
  490. uni.stopPullDownRefresh();
  491. if (res && res.code == 200) {
  492. this.myCommunity = res.data
  493. }
  494. })
  495. },
  496. //判断是否登录
  497. async judgeLogin() {
  498. let shop = uni.getStorageSync("shop")
  499. if (shop) {
  500. await this.$http.get(getAccountInfo).then(res => {
  501. uni.stopPullDownRefresh();
  502. if (res && res.code == 200) {
  503. this.isLogin = true
  504. this.userInformation = res.data;
  505. this.topData[0].value = res.data.love_value;
  506. this.topData[1].value = res.data.today_love_value;
  507. this.topData[2].value = '¥' + res.data.integral_able;
  508. this.topData[3].value = res.data.coupon_num + '张';
  509. this.isSign = res.data.sign_in;
  510. this.topData[0].value = res.data.love_value || 0;
  511. this.topData[1].value = res.data.today_love_value || 0;
  512. this.topData[2].value = res.data.integral_able || 0;
  513. this.topData[3].value = (res.data.coupon_num || 0) + '张';
  514. } else {
  515. this.isLogin = false
  516. }
  517. })
  518. } else {
  519. this.isLogin = false
  520. }
  521. },
  522. //跳转成为商家
  523. goToRegisterAndAudit() {
  524. let token = uni.getStorageSync("apiToken")
  525. if (!token) {
  526. uni.navigateTo({
  527. url: "../research/register/login"
  528. })
  529. } else {
  530. this.$http.get("/yxt/shopapply/shopApplyInfo").then(res => {
  531. if (res && res.code == 200) {
  532. if (res.data == null) {
  533. uni.navigateTo({
  534. url: "../user/merchant/registerAndAudit"
  535. })
  536. } else {
  537. uni.navigateTo({
  538. url: "../user/merchant/audit"
  539. })
  540. }
  541. }
  542. })
  543. // let personal = uni.getStorageSync("personal")
  544. // let isShop = personal.is_shop
  545. // if(isShop==true){
  546. // uni.navigateTo({
  547. // url:"../research/setup/toBusiness"
  548. // })}else{
  549. // uni.navigateTo({
  550. // url:"../user/merchant/registerAndAudit"
  551. // })
  552. // }
  553. }
  554. },
  555. //成为网红
  556. goTobecomeANerStar() {
  557. let token = uni.getStorageSync("apiToken")
  558. if (!token) {
  559. uni.navigateTo({
  560. url: "../research/register/login"
  561. })
  562. } else {
  563. //获取申请信息
  564. this.$http.get("/celebrity/info").then(res => {
  565. if (res && res.code == 200) {
  566. if (res.data !== null) {
  567. uni.navigateTo({
  568. // url:"./toExamine"
  569. url: "../research/setup/toExamine"
  570. })
  571. } else {
  572. uni.navigateTo({
  573. url: "../research/setup/becomeANetStar"
  574. })
  575. }
  576. }
  577. })
  578. }
  579. },
  580. //跳转我的银行卡
  581. goToBankCardList() {
  582. let token = uni.getStorageSync("apiToken")
  583. if (!token) {
  584. uni.navigateTo({
  585. url: "../research/register/login"
  586. })
  587. } else {
  588. uni.navigateTo({
  589. url: "../user/bankCard/bankCardList"
  590. })
  591. }
  592. },
  593. //跳转分销中心
  594. goToDistributionCentre() {
  595. let token = uni.getStorageSync("apiToken")
  596. if (!token) {
  597. uni.navigateTo({
  598. url: "../research/register/login"
  599. })
  600. } else {
  601. uni.navigateTo({
  602. url: "../user/distribution/distributionCentre"
  603. })
  604. }
  605. },
  606. //跳转我的评论
  607. goToMyComment() {
  608. let token = uni.getStorageSync("apiToken")
  609. if (!token) {
  610. uni.navigateTo({
  611. url: "../research/register/login"
  612. })
  613. } else {
  614. uni.navigateTo({
  615. url: "../research/community/mycomment?user_id=" + this.userInfo.id
  616. })
  617. }
  618. },
  619. //跳转我的点赞
  620. goToMyFabulous() {
  621. let token = uni.getStorageSync("apiToken")
  622. if (!token) {
  623. uni.navigateTo({
  624. url: "../research/register/login"
  625. })
  626. } else {
  627. uni.navigateTo({
  628. url: "../research/community/myfabulous?user_id=" + this.userInfo.id
  629. })
  630. }
  631. },
  632. //跳转我的关注
  633. goToMyFollow() {
  634. let token = uni.getStorageSync("apiToken")
  635. if (!token) {
  636. uni.navigateTo({
  637. url: "../research/register/login"
  638. })
  639. } else {
  640. uni.navigateTo({
  641. url: "../research/community/myfollow?user_id=" + this.userInfo.id
  642. })
  643. }
  644. },
  645. //跳转我的发布
  646. goToMyRelease() {
  647. let token = uni.getStorageSync("apiToken")
  648. if (!token) {
  649. uni.navigateTo({
  650. url: "../research/register/login"
  651. })
  652. } else {
  653. uni.navigateTo({
  654. url: "../research/community/myrelease?user_id=" + this.userInfo.id
  655. })
  656. }
  657. },
  658. //跳转我的主页
  659. goToHomepage() {
  660. let token = uni.getStorageSync("apiToken")
  661. if (!token) {
  662. uni.navigateTo({
  663. url: "../research/register/login"
  664. })
  665. } else {
  666. let id = this.userInfo.id
  667. uni.navigateTo({
  668. url: "../research/community/homepage?user_id=" + id
  669. })
  670. }
  671. },
  672. //跳转我的粉丝
  673. gotoFans() {
  674. let token = uni.getStorageSync("apiToken")
  675. if (!token) {
  676. uni.navigateTo({
  677. url: "/pages/login/index"
  678. })
  679. } else {
  680. uni.navigateTo({
  681. url: "../research/community/myfans?user_id=" + this.userInfo.id
  682. })
  683. }
  684. },
  685. //跳转注册
  686. goToRegister() {
  687. uni.navigateTo({
  688. url: "/pages/login/index"
  689. })
  690. },
  691. //跳转登录
  692. goToLogin() {
  693. uni.navigateTo({
  694. url: "../research/register/login"
  695. })
  696. },
  697. getuserInfo() {
  698. let shop = uni.getStorageSync('shop')
  699. this.$http.get('/account/getAccountInfo/' + shop.id).then(async res => {
  700. uni.stopPullDownRefresh();
  701. if (res && res.code == 200) {
  702. this.userInfo = res.data
  703. }
  704. })
  705. },
  706. //跳到登录页面
  707. // goLogin(url){
  708. // let token = uni.getStorageSync("apiToken")
  709. // //判断是否微信授权登录(没有授权登录进wx-login,授权了但没有注册进login)
  710. // if(!token){
  711. // uni.navigateTo({
  712. // url:"./wx-login"
  713. // })
  714. // }else if(token){
  715. // this.hiddenLink =false
  716. // uni.navigateTo({
  717. // url:url
  718. // })
  719. // }
  720. // },
  721. //跳到商家页
  722. goMerchant() {
  723. let token = uni.getStorageSync("apiToken")
  724. //判断是否微信授权登录(没有授权登录进wx-login,授权了但没有注册进login)
  725. if (!token) {
  726. uni.navigateTo({
  727. url: "./wx-login"
  728. })
  729. } else if (token) {
  730. this.hiddenLink = false
  731. this.$http.get('/yxt/shopapply/shopApplyInfo', {}).then(async res => {
  732. if (res && res.code == 200) {
  733. if (!res.data) {
  734. uni.navigateTo({
  735. url: "../user/merchant/registerAndAudit"
  736. })
  737. } else {
  738. uni.navigateTo({
  739. url: '../user/merchant/audit'
  740. })
  741. }
  742. }
  743. })
  744. }
  745. },
  746. //跳到订单列表
  747. linkOrderList(k) {
  748. let token = uni.getStorageSync("apiToken")
  749. //判断是否微信授权登录(没有授权登录进wx-login,授权了但没有注册进login)
  750. if (!token) {
  751. uni.navigateTo({
  752. url: "../research/register/login"
  753. })
  754. } else if (token) {
  755. this.hiddenLink = false
  756. uni.navigateTo({
  757. url: `../order/orderList/orderList?keys=${k}&orderType=${this.orderTypeList[this.orderTypeIndex].value}`
  758. })
  759. }
  760. },
  761. //跳服务订单列表
  762. linkServiceOrderList(v) {
  763. let token = uni.getStorageSync("apiToken")
  764. //判断是否微信授权登录(没有授权登录进wx-login,授权了但没有注册进login)
  765. if (!token) {
  766. uni.navigateTo({
  767. url: "../research/register/login"
  768. })
  769. } else if (token) {
  770. this.hiddenLink = false
  771. uni.navigateTo({
  772. url: "../order/orderList/serviceOrder?keys=" + v
  773. })
  774. }
  775. },
  776. //跳到拼团订单
  777. goGbOrder() {
  778. uni.navigateTo({
  779. url: "../order/gbOrder/gbOrderList"
  780. })
  781. },
  782. //常见问题
  783. goFaq() {
  784. uni.navigateTo({
  785. url: "../user/faq"
  786. })
  787. },
  788. //获取服务订单统计
  789. getServiceOrderCount() {
  790. this.$http.get('/order/service-order-count', {}).then(async res => {
  791. if (res && res.code == 200) {
  792. if (res.data) {
  793. this.serviceOrder.waitPayNum = res.data.wait_pay_num //待支付
  794. this.serviceOrder.waitCommentNum = res.data.wait_comment_num //待评论
  795. this.serviceOrder.waitUseNum = res.data.wait_use_num //待使用
  796. }
  797. }
  798. })
  799. },
  800. //获取普通订单统计
  801. getGeneralOrderCount() {
  802. this.$http.get(this.orderTypeIndex == 0 ? '/order/general-order-count' : '/order/apply-order-count', {})
  803. .then(async res => {
  804. if (res && res.code == 200) {
  805. if (res.data) {
  806. this.generalOrder.waitPayNum = res.data.wait_pay_num //待支付
  807. this.generalOrder.waitCommentNum = res.data.wait_comment_num //待评论
  808. this.generalOrder.waitUseNum = res.data.wait_use_num //待使用
  809. this.generalOrder.waitReceivingNum = res.data.wait_receiving_num //待收货
  810. this.generalOrder.waitShipNum = res.data.wait_ship_num //待发货
  811. }
  812. }
  813. })
  814. },
  815. tabPage(url, needLogin = false) {
  816. let token = uni.getStorageSync("apiToken")
  817. if (needLogin && !token) {
  818. uni.navigateTo({
  819. url: "../research/register/login"
  820. })
  821. return;
  822. }
  823. uni.navigateTo({
  824. url
  825. })
  826. },
  827. // 获取联盟商家订单统计信息
  828. getAffiliateMerchantOrder() {
  829. this.$http.get('/offlineorder/mycount').then(res => {
  830. if (res.code == 200) {
  831. this.affiliateMerchantOrderInfo = res.data
  832. }
  833. })
  834. },
  835. // 跳转联盟商家列表
  836. affiliateMerchantOrderList() {
  837. uni.navigateTo({
  838. url: '/pages/workbench/order/coalitionList'
  839. })
  840. }
  841. }
  842. }
  843. </script>
  844. <style>
  845. page {
  846. background-color: #FFFFFF;
  847. }
  848. </style>
  849. <style lang="scss" scoped>
  850. .goodBug {
  851. font-size: 40rpx;
  852. color: #FFFFFF;
  853. font-weight: 400;
  854. width: 400rpx;
  855. overflow: hidden;
  856. white-space: nowrap;
  857. text-overflow: ellipsis;
  858. margin-top: 30rpx;
  859. }
  860. // 我的钱包
  861. .money-and-integral {
  862. margin-left: 30rpx;
  863. margin-right: 30rpx;
  864. margin-top: 24rpx;
  865. display: flex;
  866. justify-content: space-around;
  867. align-items: center;
  868. color: #ffffff;
  869. .money {
  870. text-align: center;
  871. .num {
  872. font-size: 48rpx;
  873. color: #ffffff;
  874. font-weight: Bold;
  875. text {
  876. font-size: 28rpx;
  877. font-weight: Medium;
  878. flood-color: #ffffff;
  879. }
  880. }
  881. }
  882. .middle-line {
  883. background-color: #FFFFFF;
  884. height: 70rpx;
  885. width: 1rpx;
  886. opacity: 0.53;
  887. }
  888. .integral {
  889. text-align: center;
  890. .num {
  891. font-size: 48rpx;
  892. font-weight: Bold;
  893. color: #ffffff;
  894. text {
  895. font-size: 28rpx;
  896. font-weight: Medium;
  897. }
  898. }
  899. .my-integral {
  900. margin-top: 4rpx;
  901. .iconfont {
  902. width: 46rpx;
  903. height: 46rpx;
  904. background-color: #ffffff;
  905. color: #29A549;
  906. border-radius: 999rpx;
  907. text-align: center;
  908. line-height: 46rpx;
  909. }
  910. .my-iconfont-item {
  911. font-size: 28rpx;
  912. font-weight: Medium;
  913. color: #ffffff;
  914. margin-left: 8rpx;
  915. height: 46rpx;
  916. line-height: 46rpx;
  917. }
  918. }
  919. }
  920. .my-integral {
  921. display: flex;
  922. }
  923. .my-money {
  924. margin-top: 4rpx;
  925. display: flex;
  926. .iconfont {
  927. background-color: #ffffff;
  928. color: #29A549;
  929. width: 46rpx;
  930. height: 46rpx;
  931. border-radius: 999rpx;
  932. text-align: center;
  933. line-height: 46rpx;
  934. }
  935. .my-money-item {
  936. margin-left: 8rpx;
  937. font-size: 28rpx;
  938. font-weight: Medium;
  939. height: 46rpx;
  940. line-height: 46rpx;
  941. }
  942. }
  943. }
  944. .navbar {
  945. position: absolute;
  946. top: 0;
  947. left: 0;
  948. }
  949. .top {
  950. position: relative;
  951. min-height: 100vh;
  952. background-color: #ffffff;
  953. }
  954. .bgImg {
  955. // position: absolute;
  956. // top: 480rpx;
  957. width: 100%;
  958. padding: 30rpx;
  959. // margin: 60rpx 0 30rpx;
  960. }
  961. .bgImg image {
  962. width: 100%;
  963. // height: 103vh;
  964. position: relative;
  965. }
  966. .position-ab {
  967. // position: relative;
  968. // top: -45rpx;
  969. width: 100%;
  970. // padding-bottom: 175rpx;
  971. border-radius: 20rpx;
  972. box-shadow: 0 0 40rpx rgba(0, 0, 0, .1);
  973. .middle {
  974. margin: 0 30rpx;
  975. background: #ffffff;
  976. // margin-top: 32rpx;
  977. border-radius: 20rpx;
  978. padding-bottom: 40rpx;
  979. .middle-content {
  980. display: flex;
  981. justify-content: space-around;
  982. .list {
  983. flex: 1;
  984. text-align: center;
  985. .my-icon {
  986. width: 52rpx;
  987. height: 50rpx;
  988. }
  989. .name-one {
  990. font-size: 26rpx;
  991. color: #1a1a1a;
  992. font-weight: 400;
  993. margin-top: 18rpx;
  994. }
  995. .anglenum {
  996. position: absolute;
  997. margin-left: 95rpx;
  998. margin-top: -20rpx;
  999. background-color: #ff0000;
  1000. padding: 0px 11rpx;
  1001. border-radius: 100rpx;
  1002. font-weight: 400;
  1003. font-size: 23rpx;
  1004. color: #ffffff
  1005. }
  1006. .one {
  1007. font-size: 52rpx;
  1008. // background: linear-gradient(180deg, #78df6a, #11d688);
  1009. background: #f35427;
  1010. -webkit-background-clip: text;
  1011. color: transparent;
  1012. }
  1013. .two {
  1014. font-size: 50rpx;
  1015. // background: linear-gradient(180deg, #dc9c56, #ff7303);
  1016. background: #ff9301;
  1017. -webkit-background-clip: text;
  1018. color: transparent;
  1019. }
  1020. .three {
  1021. font-size: 52rpx;
  1022. // background: linear-gradient(180deg, #05d3a9, #06b806);
  1023. background: #ea632a;
  1024. -webkit-background-clip: text;
  1025. color: transparent;
  1026. }
  1027. .four {
  1028. font-size: 52rpx;
  1029. // background: linear-gradient(180deg, #ff5475, #fd4303);
  1030. background: #f2ad41;
  1031. -webkit-background-clip: text;
  1032. color: transparent;
  1033. }
  1034. .five {
  1035. font-size: 52rpx;
  1036. // background: linear-gradient(180deg, #b175f0, #3db3fd);
  1037. background: #2e6cf6;
  1038. -webkit-background-clip: text;
  1039. color: transparent;
  1040. }
  1041. }
  1042. }
  1043. .middle-top {
  1044. margin: 0 0 30rpx;
  1045. margin-bottom: 32rpx;
  1046. border-bottom: 1rpx solid #e6e6e6;
  1047. display: flex;
  1048. padding: 30rpx 0;
  1049. justify-content: space-between;
  1050. align-items: center;
  1051. .order {
  1052. font-size: 30rpx;
  1053. color: #808080;
  1054. display: block;
  1055. &.active {
  1056. color: #1A1A1A;
  1057. font-weight: Bold;
  1058. }
  1059. }
  1060. .whole {
  1061. display: flex;
  1062. align-items: center;
  1063. color: #999999;
  1064. font-size: 24rpx;
  1065. font-weight: 400;
  1066. .whole-top {
  1067. color: #999999;
  1068. font-size: 28rpx;
  1069. font-weight: 400;
  1070. }
  1071. .wholeright {
  1072. color: #999999;
  1073. font-size: 35rpx;
  1074. // margin-top: 4rpx;
  1075. margin-left: 16rpx;
  1076. }
  1077. }
  1078. }
  1079. }
  1080. .other {
  1081. margin: 30rpx;
  1082. background-color: #ffffff;
  1083. padding: 50rpx 0;
  1084. border-radius: 20rpx;
  1085. .option {
  1086. display: flex;
  1087. justify-content: space-between;
  1088. .list {
  1089. text-align: center;
  1090. .my-icon {
  1091. width: 52rpx;
  1092. height: 50rpx;
  1093. }
  1094. .name-one {
  1095. font-size: 26rpx;
  1096. color: #1a1a1a;
  1097. font-weight: 400;
  1098. margin-top: 18rpx;
  1099. }
  1100. .othernum {
  1101. position: absolute;
  1102. margin-left: 65rpx;
  1103. margin-top: -10rpx;
  1104. background-color: #ff0000;
  1105. padding: 0px 11rpx;
  1106. border-radius: 100rpx;
  1107. font-weight: 400;
  1108. color: #ffffff;
  1109. font-size: 23rpx;
  1110. }
  1111. .one {
  1112. font-size: 52rpx;
  1113. background: linear-gradient(180deg, #78df6a, #11d688);
  1114. -webkit-background-clip: text;
  1115. color: transparent;
  1116. }
  1117. .two {
  1118. font-size: 50rpx;
  1119. background: linear-gradient(180deg, #dc9c56, #ff7303);
  1120. -webkit-background-clip: text;
  1121. color: transparent;
  1122. }
  1123. .four {
  1124. font-size: 52rpx;
  1125. background: linear-gradient(180deg, #ff5475, #fd4303);
  1126. -webkit-background-clip: text;
  1127. color: transparent;
  1128. }
  1129. .five {
  1130. font-size: 52rpx;
  1131. background: linear-gradient(180deg, #b175f0, #3db3fd);
  1132. -webkit-background-clip: text;
  1133. color: transparent;
  1134. }
  1135. }
  1136. }
  1137. .other-top {
  1138. display: flex;
  1139. padding-bottom: 18rpx;
  1140. align-items: center;
  1141. margin-bottom: 32rpx;
  1142. border-bottom: 1rpx solid #e6e6e6;
  1143. .left {
  1144. flex: 1;
  1145. font-size: 30rpx;
  1146. font-weight: 700;
  1147. color: #1A1A1A;
  1148. line-height: 30rpx;
  1149. }
  1150. .right {
  1151. color: #999999;
  1152. font-size: 28rpx;
  1153. line-height: 30rpx;
  1154. font-weight: 400;
  1155. display: flex;
  1156. align-items: center;
  1157. .other-icon {
  1158. color: #999999;
  1159. margin-left: 16rpx;
  1160. font-size: 15rpx;
  1161. }
  1162. }
  1163. }
  1164. .order-info {
  1165. display: flex;
  1166. justify-content: space-around;
  1167. align-items: center;
  1168. font-size: 26rpx;
  1169. font-family: PingFang SC, PingFang SC-Regular;
  1170. font-weight: 400;
  1171. color: #1a1a1a;
  1172. .item {
  1173. max-width: 30%;
  1174. text-align: center;
  1175. .num {
  1176. font-size: 36rpx;
  1177. color: #ff6600;
  1178. margin-bottom: 18rpx;
  1179. overflow: hidden;
  1180. text-overflow: ellipsis;
  1181. white-space: nowrap;
  1182. }
  1183. }
  1184. }
  1185. }
  1186. .tool {
  1187. margin: 0rpx 30rpx 30rpx 30rpx;
  1188. padding: 18rpx 30rpx;
  1189. background-color: #ffffff;
  1190. border-radius: 20rpx;
  1191. .image-text {
  1192. .list-top {
  1193. display: flex;
  1194. justify-content: space-around;
  1195. }
  1196. .list-bottom {
  1197. display: flex;
  1198. justify-content: space-around;
  1199. }
  1200. .item-one {
  1201. text-align: center;
  1202. width: 25%;
  1203. image {
  1204. text-align: center;
  1205. width: 80rpx;
  1206. height: 80rpx;
  1207. padding: 34rpx 10rpx 14rpx 10rpx;
  1208. }
  1209. .item-name {
  1210. text-align: center;
  1211. font-size: 26rpx;
  1212. font-weight: 400;
  1213. padding-bottom: 44rpx;
  1214. color: #1A1A1A;
  1215. }
  1216. }
  1217. }
  1218. .tool-top {
  1219. padding: 18rpx 0rpx 18rpx 0rpx;
  1220. border-bottom: 1rpx solid #e6e6e6;
  1221. font-size: 30rpx;
  1222. font-weight: 700;
  1223. font-family: 700;
  1224. color: #1a1a1a;
  1225. line-height: 30rpx;
  1226. }
  1227. }
  1228. .wallet-bg {
  1229. position: relative;
  1230. height: 138rpx;
  1231. }
  1232. .wallet-bg .bigBg {
  1233. position: absolute;
  1234. z-index: 0;
  1235. padding: 0 15rpx;
  1236. box-sizing: border-box;
  1237. width: 100%;
  1238. height: 138rpx;
  1239. }
  1240. .wallet image {
  1241. width: 32rpx;
  1242. height: 34rpx;
  1243. }
  1244. .my-wallet {
  1245. position: relative;
  1246. z-index: 1;
  1247. height: 138rpx;
  1248. }
  1249. }
  1250. .guess {
  1251. margin: 0 30rpx;
  1252. .guess-item {
  1253. display: flex;
  1254. // justify-content: space-around;
  1255. flex-wrap: wrap;
  1256. .item {
  1257. margin-bottom: 36rpx;
  1258. background-color: #ffffff;
  1259. overflow: hidden;
  1260. display: flex;
  1261. flex-direction: column;
  1262. border-radius: 20rpx 20rpx 0 0;
  1263. box-shadow: 0 0 40rpx rgba(0, 0, 0, .1);
  1264. image {
  1265. width: 336rpx;
  1266. height: 336rpx;
  1267. border-radius: 18rpx;
  1268. }
  1269. .name {
  1270. margin: 6rpx 20rpx;
  1271. width: 296rpx;
  1272. height: 70rpx;
  1273. overflow: hidden;
  1274. text-overflow: ellipsis;
  1275. display: -webkit-box;
  1276. -webkit-line-clamp: 2;
  1277. -webkit-box-orient: vertical;
  1278. word-wrap: break-word;
  1279. word-break: break-all;
  1280. white-space: normal !important;
  1281. }
  1282. .tag-box {
  1283. margin: 10rpx 20rpx 0 20rpx;
  1284. .tag1 {
  1285. width: 69rpx;
  1286. height: 30rpx;
  1287. }
  1288. .tag2 {
  1289. width: 116rpx;
  1290. height: 30rpx;
  1291. margin-left: 10rpx;
  1292. }
  1293. }
  1294. .number {
  1295. display: flex;
  1296. align-items: flex-end;
  1297. // padding-bottom: 40rpx;
  1298. margin: 0 20rpx 0 20rpx;
  1299. .number-red {
  1300. color: #FF6600;
  1301. font-size: 36rpx;
  1302. font-weight: 700;
  1303. text {
  1304. font-size: 36rpx;
  1305. font-weight: Bold;
  1306. }
  1307. }
  1308. .number-grey {
  1309. color: #999999;
  1310. font-size: 22rpx;
  1311. font-weight: 400;
  1312. text-decoration: line-through;
  1313. margin-left: 16rpx;
  1314. padding-bottom: 4rpx;
  1315. }
  1316. }
  1317. }
  1318. .item:nth-child(2n) {
  1319. margin-left: 18rpx;
  1320. }
  1321. }
  1322. .guess-top {
  1323. display: flex;
  1324. align-items: center;
  1325. margin-bottom: 24rpx;
  1326. .guess-left {
  1327. font-size: 36rpx;
  1328. color: #1a1a1a;
  1329. font-weight: Bold;
  1330. line-height: 30rpx;
  1331. }
  1332. .guess-line {
  1333. width: 1rpx;
  1334. height: 32rpx;
  1335. background-color: #707070;
  1336. margin: 0 16rpx;
  1337. }
  1338. .guess-right {
  1339. font-size: 24rpx;
  1340. color: #666666;
  1341. font-weight: Regular;
  1342. line-height: 24rpx;
  1343. }
  1344. }
  1345. }
  1346. .top-data-box2 {
  1347. width: 690rpx;
  1348. margin: 0 auto;
  1349. height: 133rpx;
  1350. background: #ffffff;
  1351. border-radius: 20rpx;
  1352. padding: 30rpx 30rpx;
  1353. box-sizing: border-box;
  1354. display: flex;
  1355. justify-content: space-between;
  1356. align-items: center;
  1357. .item {
  1358. text-align: center;
  1359. display: flex;
  1360. justify-content: space-between;
  1361. align-items: center;
  1362. .icon {
  1363. width: 50rpx;
  1364. height: 50rpx;
  1365. border-radius: 50%;
  1366. background: #138e46;
  1367. margin: 0 auto 0 6rpx;
  1368. &.active {
  1369. background: #FF4141;
  1370. }
  1371. .iconfont2 {
  1372. font-size: 28rpx;
  1373. line-height: 50rpx;
  1374. color: white;
  1375. }
  1376. }
  1377. .title {
  1378. font-size: 28rpx;
  1379. font-family: PingFang SC, PingFang SC-Bold;
  1380. font-weight: 700;
  1381. color: #1a1a1a;
  1382. margin-bottom: 3rpx;
  1383. }
  1384. .tip {
  1385. font-size: 24rpx;
  1386. font-family: PingFang SC, PingFang SC-Regular;
  1387. font-weight: 400;
  1388. color: #808080;
  1389. }
  1390. }
  1391. }
  1392. </style>