index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  1. <template>
  2. <view style="padding-bottom: 100upx">
  3. <view class="bg padding-bottom">
  4. <view class="u-flex padding">
  5. <view class="u-m-r-10">
  6. <!-- @click="goNav('/pages/my/userinfo')" -->
  7. <image :src="shopCover" style="width: 100rpx; height: 100rpx; border-radius: 100rpx" @click="goNavs(list[0].url)"></image>
  8. </view>
  9. <view class="u-flex-1 u-m-l-10 flex justify-between align-center" v-if="!isLogin">
  10. <view class="u-font-18 text-bold">
  11. <!-- #ifdef MP-WEIXIN -->
  12. <view class="margin-left-sm margin-top-xs" style="width: 180px">{{ shopName }}</view>
  13. <!-- #endif -->
  14. <!-- #ifndef MP-WEIXIN -->
  15. <view class="margin-left-sm margin-top-xs" style="width: 180px">{{ shopName }}</view>
  16. <!-- #endif -->
  17. </view>
  18. <view class="erweima" @click="shopQr()">二维码</view>
  19. </view>
  20. <view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">登录</view>
  21. </view>
  22. <view class="moneybox" v-if="XCXIsSelect == '是'">
  23. <view class="padding" style="background: #fcd202; border-radius: 20upx 20upx 0upx 0upx">
  24. <view class="flex justify-between">
  25. <view>
  26. <view>累计收益(元)</view>
  27. <view class="margin-top-xs" style="font-size: 40upx">
  28. <text style="font-size: 55upx">{{ sumMoney }}</text>
  29. </view>
  30. </view>
  31. <view class="btn" @click="goQian()">立即提现</view>
  32. </view>
  33. <view class="flex justify-between align-center text-center margin-top">
  34. <view>
  35. <view>今日收益</view>
  36. <view class="margin-top-xs" style="font-size: 38upx">
  37. <text style="font-size: 48upx">{{ dayMoney ? dayMoney : '0' }}</text>
  38. </view>
  39. </view>
  40. <view>
  41. <view>本月收益</view>
  42. <view class="margin-top-xs" style="font-size: 38upx">
  43. <text style="font-size: 48upx">{{ monthMoney ? monthMoney : '0' }}</text>
  44. </view>
  45. </view>
  46. <view>
  47. <view>本月提现</view>
  48. <view class="margin-top-xs" style="font-size: 38upx">
  49. <text style="font-size: 48upx">{{ cashMoney ? cashMoney : '0' }}</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="flex align-center justify-between padding-lr padding-tb-sm" style="background: #fcb202; border-radius: 0upx 0upx 20upx 20upx">
  55. <view class="">每次提现平台将扣除相应手续费</view>
  56. <view class="xflist" @click="goNav('/my/other/cashList')">钱包明细</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="bg margin-top-sm">
  61. <!-- 店铺管理 -->
  62. <view class="flex padding-lr padding-tb dfs" @click="goNavs(list[0].url)">
  63. <image :src="list[0].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  64. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[0].title }}</view>
  65. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  66. </view>
  67. <!-- 订阅消息配置 -->
  68. <view class="flex padding-lr padding-tb dfs" v-if="userId">
  69. <image src="../../static/images/my/dianpu.png" style="width: 50rpx; height: 50rpx" mode=""></image>
  70. <view class="flex-sub margin-left text-df" style="line-height: 50upx">订阅消息配置</view>
  71. <switch color="#1677ff" :checked="isChecked" @change="switchChange" />
  72. </view>
  73. <!-- 商品管理 -->
  74. <view class="flex padding-lr padding-tb dfs" @click="goNavs(list[1].url)">
  75. <image :src="list[1].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  76. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[1].title }}</view>
  77. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  78. </view>
  79. <!-- 订单管理 -->
  80. <view class="flex padding-lr padding-tb" @click="goOrder()">
  81. <image :src="list[2].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  82. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[2].title }}</view>
  83. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  84. </view>
  85. <!-- 分类管理 -->
  86. <view class="flex padding-lr padding-tb" @click="goNavs(list[3].url)">
  87. <image :src="list[3].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  88. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[3].title }}</view>
  89. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  90. </view>
  91. <!-- 规格管理 -->
  92. <view class="flex padding-lr padding-tb" @click="goNavs(list[4].url)">
  93. <image :src="list[4].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  94. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[4].title }}</view>
  95. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  96. </view>
  97. <!-- 保证金 -->
  98. <view class="flex padding-lr padding-tb" @click="goNav(list[5].url)" v-if="XCXIsSelect == '是'">
  99. <image :src="list[5].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  100. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[5].title }}</view>
  101. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  102. </view>
  103. <!-- 规格管理 -->
  104. <view class="flex padding-lr padding-tb" @click="goNavs(list[13].url)">
  105. <image :src="list[13].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  106. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[13].title }}</view>
  107. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  108. </view>
  109. <!-- 精选活动 -->
  110. <view class="flex padding-lr padding-tb" @click="goNavs(list[14].url)">
  111. <image :src="list[14].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  112. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[14].title }}</view>
  113. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  114. </view>
  115. <!-- 优惠券管理 -->
  116. <view class="flex padding-lr padding-tb" @click="goNavs(list[15].url)">
  117. <image :src="list[15].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  118. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[15].title }}</view>
  119. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  120. </view>
  121. <!-- 打印机配置 -->
  122. <view class="flex padding-lr padding-tb" @click="goNavs(list[16].url)">
  123. <image :src="list[16].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  124. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[16].title }}</view>
  125. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  126. </view>
  127. <!-- 供货订购 -->
  128. <view class="flex padding-lr padding-tb" @click="goGong()">
  129. <image :src="list[17].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  130. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[17].title }}</view>
  131. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  132. </view>
  133. </view>
  134. <view class="bg margin-top-sm">
  135. <!-- 聊天中心 -->
  136. <view class="flex padding-lr padding-tb dfs" @click="goNav(list[12].url)">
  137. <image :src="list[12].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  138. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[12].title }}</view>
  139. <view class="flex align-center">
  140. <view v-if="messageCount" class="bott">{{ messageCount }}</view>
  141. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  142. </view>
  143. </view>
  144. <!-- 联系客服 -->
  145. <view class="flex padding-lr padding-tb dfs" @click="goNav(list[6].url)">
  146. <image :src="list[6].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  147. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[6].title }}</view>
  148. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  149. </view>
  150. <!-- 关于我们 -->
  151. <!-- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[7].url)">
  152. <image :src="list[7].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
  153. <view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[7].title}}</view>
  154. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  155. </view> -->
  156. <!-- 意见反馈 -->
  157. <view class="flex padding-lr padding-tb dfs" @click="goNav(list[8].url)" v-if="XCXIsSelect == '是'">
  158. <image :src="list[8].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  159. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[8].title }}</view>
  160. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  161. </view>
  162. <!-- 我的投诉 -->
  163. <view class="flex padding-lr padding-tb dfs" @click="goNav(list[9].url)">
  164. <image :src="list[9].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  165. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[9].title }}</view>
  166. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  167. </view>
  168. <!-- #ifdef MP-WEIXIN -->
  169. <view class="flex padding-lr padding-tb dfs" @click="gouser()">
  170. <image :src="list[10].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  171. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[10].title }}</view>
  172. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  173. </view>
  174. <!-- #endif -->
  175. <!-- 系统设置 -->
  176. <view class="flex padding-lr padding-tb dfs" @click="goset()">
  177. <image :src="list[11].image" style="width: 50rpx; height: 50rpx" mode=""></image>
  178. <view class="flex-sub margin-left text-df" style="line-height: 50upx">{{ list[11].title }}</view>
  179. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  180. </view>
  181. <!-- 退出登录 -->
  182. <!-- <view class="flex padding-lr padding-tb dfs" @click="TuiLogin()" v-if="!isLogin">
  183. <image :src="list[10].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
  184. <view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[10].title}}</view>
  185. <image src="../../static/images/my/right.png" class="images" mode=""></image>
  186. </view> -->
  187. </view>
  188. <u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="500rpx" :closeable="closeable">
  189. <view style="width: 180px; height: 180px; margin: 40px auto">
  190. <image :src="shopQrImg" style="width: 100%; height: 100%" @click="previewImage"></image>
  191. </view>
  192. </u-popup>
  193. </view>
  194. </template>
  195. <script>
  196. import configurl from '../../common/config.js'
  197. import { encrypt, decrypt, urlSafeBase64Decode, urlSafeBase64Encode } from '@/utils/cryptojs.js'
  198. export default {
  199. data() {
  200. return {
  201. shopCover: '../../static/logo.png',
  202. isLogin: true,
  203. shopName: '匿名',
  204. sumMoney: 0, //累计余额
  205. dayMoney: 0, //今日收益
  206. monthMoney: 0, //本月预估收益
  207. cashMoney: 0, // 本月预估提现
  208. shopToken: '',
  209. isVip: false,
  210. invitationCode: '', //邀请码
  211. list: [
  212. {
  213. image: '../../static/images/my/dianpu.png',
  214. title: '店铺管理',
  215. url: '/my/store/index'
  216. },
  217. {
  218. image: '../../static/images/my/shangpin.png',
  219. title: '商品管理',
  220. url: '/my/store/addgood'
  221. },
  222. {
  223. image: '../../static/images/my/order.png',
  224. title: '订单管理',
  225. url: '/pages/order/index'
  226. },
  227. {
  228. image: '../../static/images/my/fenlei.png',
  229. title: '分类管理',
  230. url: '/my/store/fenlei'
  231. },
  232. {
  233. image: '../../static/images/my/guige.png',
  234. title: '规格管理',
  235. url: '/my/store/guige'
  236. },
  237. {
  238. image: '../../static/images/my/baozhengjin.png',
  239. title: '保证金',
  240. url: '/my/other/money'
  241. },
  242. {
  243. image: '../../static/images/my/kefu.png',
  244. title: '联系客服',
  245. url: '/pages/my/chat'
  246. },
  247. {
  248. image: '../../static/images/my/guanyu.png',
  249. title: '关于我们',
  250. url: '/my/other/about'
  251. },
  252. {
  253. image: '../../static/images/my/yijian.png',
  254. title: '意见反馈',
  255. url: '/my/feedback/index'
  256. },
  257. {
  258. image: '../../static/images/my/00.png',
  259. title: '我的投诉',
  260. url: '/my/other/tousu'
  261. },
  262. {
  263. image: '../../static/images/my/user.png',
  264. title: '前往用户端',
  265. url: ''
  266. },
  267. {
  268. image: '../../static/images/my/set1.png',
  269. title: '系统设置',
  270. url: '/my/other/set'
  271. },
  272. {
  273. image: '../../static/images/my/liaotian.png',
  274. title: '聊天中心',
  275. url: '/pages/my/liaotian'
  276. },
  277. {
  278. image: '../../static/images/order/pinglun.png',
  279. title: '店铺评价',
  280. url: '/my/store/pingjia'
  281. },
  282. {
  283. image: '../../static/images/order/hd.png',
  284. title: '精选活动',
  285. url: '/my/store/huodong'
  286. },
  287. {
  288. image: '../../static/images/order/yhq.png',
  289. title: '优惠券管理',
  290. url: '/my/yhq/yhq'
  291. },
  292. {
  293. image: '../../static/images/order/print.png',
  294. title: '打印机配置',
  295. url: '/my/print/print'
  296. },
  297. {
  298. image: '../../static/images/order/gonghuo.png',
  299. title: '供货订购',
  300. url: ''
  301. }
  302. ],
  303. renzheng: 0,
  304. XCXIsSelect: '否',
  305. isCashDeposit: '',
  306. show: false,
  307. shopQrImg: '',
  308. closeable: true,
  309. open: true,
  310. arr: [],
  311. messageCount: '',
  312. isChecked: false,
  313. userId: ''
  314. }
  315. },
  316. onLoad() {
  317. // this.messageCount = uni.getStorageSync('messageCount')
  318. this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
  319. this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
  320. this.userId = uni.getStorageSync('userId')
  321. this.open = uni.getStorageSync('open')
  322. this.$Request.getT('/app/common/type/354').then((res) => {
  323. //订单取消通知
  324. if (res.code == 0) {
  325. if (res.data && res.data.value) {
  326. this.arr.push(res.data.value)
  327. }
  328. }
  329. })
  330. this.$Request.getT('/app/common/type/353').then((res) => {
  331. //订单取消通知
  332. if (res.code == 0) {
  333. if (res.data && res.data.value) {
  334. this.arr.push(res.data.value)
  335. }
  336. }
  337. })
  338. this.$Request.getT('/app/common/type/352').then((res) => {
  339. //新订单通知
  340. if (res.code == 0) {
  341. if (res.data && res.data.value) {
  342. this.arr.push(res.data.value)
  343. }
  344. }
  345. })
  346. // let that= this
  347. // if (this.open = true) {
  348. // uni.showModal({
  349. // title: '提示',
  350. // content: '请先去完善店铺信息,上线店铺后同城外卖用户端首页展示您的店铺。',
  351. // success: function(res) {
  352. // if (res.confirm) {
  353. // console.log('用户点击确定');
  354. // that.open = false
  355. // that.$queue.setData("open", that.open);
  356. // } else if (res.cancel) {
  357. // console.log('用户点击取消');
  358. // that.open = false
  359. // that.$queue.setData("open", that.open);
  360. // }
  361. // }
  362. // })
  363. // }
  364. },
  365. onShow() {
  366. this.userId = uni.getStorageSync('userId')
  367. this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
  368. if (this.shopToken) {
  369. this.messageCount = uni.getStorageSync('messageCount')
  370. this.isLogin = false
  371. this.getUserInfo()
  372. this.getshanghuinfo()
  373. this.getAmount()
  374. } else {
  375. this.isLogin = true
  376. this.shopName = '匿名'
  377. this.shopCover = '../../static/logo.png'
  378. this.sumMoney = 0 //累计余额
  379. this.dayMoney = 0 //今日收益
  380. this.monthMoney = 0 //本月收益
  381. this.cashMoney = 0 //本月提现
  382. }
  383. if (this.userId) {
  384. this.getSetData()
  385. }
  386. },
  387. methods: {
  388. getSetData() {
  389. // 获取订阅消息配置
  390. let data = {
  391. shopId: uni.getStorageSync('shopId')
  392. }
  393. this.$Request.getT('/app/goods/selectGoodShop', data).then((res) => {
  394. // console.log(res, '666')
  395. if (res.code == 0) {
  396. if (res.data.messageConfiguration == 1) {
  397. this.isChecked = false
  398. } else {
  399. this.isChecked = true
  400. }
  401. }
  402. })
  403. },
  404. previewImage() {
  405. var arr = []
  406. arr.push(this.shopQrImg)
  407. //uniapp预览轮播图方法
  408. uni.previewImage({
  409. current: 0, //预览图片的下标
  410. urls: arr //预览图片的地址,必须要数组形式
  411. })
  412. },
  413. //跳转设置
  414. goset() {
  415. uni.navigateTo({
  416. url: '/my/other/set'
  417. })
  418. },
  419. //生成二维码
  420. shopQr() {
  421. // uni.showLoading({
  422. // title: '二维码生成中',
  423. // duration: 1000,
  424. // icon: 'none'
  425. // });
  426. this.show = true
  427. // var data={
  428. // shopId:uni.getStorageSync('shopId')
  429. // }
  430. // this.$Request.get("/invite/shopQr",data).then(res => {
  431. // if (res.code == 0) {
  432. // console.log(res,'oooo')
  433. // this.checked = res.data.isSendMsg == null || res.data.isSendMsg == 1 ? true : false
  434. // }
  435. // });
  436. var shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
  437. this.shopQrImg = configurl.APIHOSTsss + '/sqx_fast/invite/shopQr?shopId=' + shopid
  438. console.log(this.shopQrImg, 'oooo')
  439. },
  440. //跳转用户端
  441. gouser() {
  442. wx.navigateToMiniProgram({
  443. appId: 'wx45ab46867002aa0b',
  444. path: '/pages/index/index',
  445. envVersion: 'release', // 打开正式版
  446. success(res) {
  447. // 打开成功
  448. },
  449. fail: function (err) {
  450. console.log(err)
  451. }
  452. })
  453. },
  454. //跳转供货商
  455. goGong() {
  456. wx.navigateToMiniProgram({
  457. appId: 'wx45ab46867002aa0b',
  458. path: '/pages/index/shopList/indexShop',
  459. envVersion: 'release', // 打开正式版release
  460. success(res) {
  461. // 打开成功
  462. },
  463. fail: function (err) {
  464. console.log(err)
  465. }
  466. })
  467. },
  468. goQian() {
  469. if (this.shopToken) {
  470. // #ifdef MP-WEIXIN
  471. if (uni.getStorageSync('sendindexMsg')) {
  472. uni.requestSubscribeMessage({
  473. tmplIds: this.arr,
  474. success(re) {
  475. // console.log(re,'**********')
  476. var datas = JSON.stringify(re)
  477. if (datas.indexOf('accept') != -1) {
  478. console.log(re)
  479. }
  480. },
  481. fail: (res) => {
  482. console.log(res)
  483. }
  484. })
  485. }
  486. // #endif
  487. uni.navigateTo({
  488. url: '/my/other/wallet'
  489. })
  490. } else {
  491. uni.showModal({
  492. title: '提示',
  493. content: '您还未登录,请先登录',
  494. success: function (res) {
  495. if (res.confirm) {
  496. console.log('用户点击确定')
  497. uni.navigateTo({
  498. url: '/pages/my/loginphone'
  499. })
  500. } else if (res.cancel) {
  501. console.log('用户点击取消')
  502. }
  503. }
  504. })
  505. }
  506. },
  507. bindFb() {
  508. let renzheng = uni.getStorageSync('renzheng')
  509. console.log(this.userId, renzheng)
  510. if (this.shopToken) {
  511. // #ifdef MP-WEIXIN
  512. if (uni.getStorageSync('sendindexMsg')) {
  513. uni.requestSubscribeMessage({
  514. tmplIds: this.arr,
  515. success(re) {
  516. // console.log(re,'**********')
  517. var datas = JSON.stringify(re)
  518. if (datas.indexOf('accept') != -1) {
  519. console.log(re)
  520. }
  521. },
  522. fail: (res) => {
  523. console.log(res)
  524. }
  525. })
  526. }
  527. // #endif
  528. uni.navigateTo({
  529. url: '/my/publish/editor'
  530. })
  531. } else {
  532. uni.showModal({
  533. title: '提示',
  534. content: '您还未登录,请先登录',
  535. success: function (res) {
  536. if (res.confirm) {
  537. console.log('用户点击确定')
  538. uni.navigateTo({
  539. url: '/pages/my/loginphone'
  540. })
  541. } else if (res.cancel) {
  542. console.log('用户点击取消')
  543. }
  544. }
  545. })
  546. }
  547. },
  548. goOrder() {
  549. uni.switchTab({
  550. url: '/pages/order/index'
  551. })
  552. },
  553. //列表跳转
  554. goNav(e, name) {
  555. console.log(e)
  556. if (this.shopToken) {
  557. // #ifdef MP-WEIXIN
  558. if (uni.getStorageSync('sendindexMsg')) {
  559. uni.requestSubscribeMessage({
  560. tmplIds: this.arr,
  561. success(re) {
  562. // console.log(re,'**********')
  563. var datas = JSON.stringify(re)
  564. if (datas.indexOf('accept') != -1) {
  565. console.log(re)
  566. }
  567. },
  568. fail: (res) => {
  569. console.log(res)
  570. }
  571. })
  572. }
  573. // #endif
  574. uni.navigateTo({
  575. url: e
  576. })
  577. } else {
  578. uni.showModal({
  579. title: '提示',
  580. content: '您还未登录,请先登录',
  581. success: function (res) {
  582. if (res.confirm) {
  583. console.log('用户点击确定')
  584. uni.navigateTo({
  585. url: '/pages/my/loginphone'
  586. })
  587. } else if (res.cancel) {
  588. console.log('用户点击取消')
  589. }
  590. }
  591. })
  592. }
  593. },
  594. //列表跳转
  595. goNavs(e, name) {
  596. console.log(e)
  597. let cashDeposit = uni.getStorageSync('cashDeposit')
  598. if (this.shopToken) {
  599. // #ifdef MP-WEIXIN
  600. if (uni.getStorageSync('sendindexMsg')) {
  601. uni.requestSubscribeMessage({
  602. tmplIds: this.arr,
  603. success(re) {
  604. // console.log(re,'**********')
  605. var datas = JSON.stringify(re)
  606. if (datas.indexOf('accept') != -1) {
  607. console.log(re)
  608. }
  609. },
  610. fail: (res) => {
  611. console.log(res)
  612. }
  613. })
  614. }
  615. // #endif
  616. if (cashDeposit == 0 || cashDeposit == 'null') {
  617. uni.showModal({
  618. title: '提示',
  619. content: '您还未缴纳保证金,请先去缴纳保证金',
  620. success: function (res) {
  621. if (res.confirm) {
  622. console.log('用户点击确定')
  623. uni.navigateTo({
  624. url: '/my/other/money'
  625. })
  626. } else if (res.cancel) {
  627. console.log('用户点击取消')
  628. }
  629. }
  630. })
  631. } else {
  632. uni.navigateTo({
  633. url: e
  634. })
  635. }
  636. } else {
  637. uni.showModal({
  638. title: '提示',
  639. content: '您还未登录,请先登录',
  640. success: function (res) {
  641. if (res.confirm) {
  642. console.log('用户点击确定')
  643. uni.navigateTo({
  644. url: '/pages/my/loginphone'
  645. })
  646. } else if (res.cancel) {
  647. console.log('用户点击取消')
  648. }
  649. }
  650. })
  651. }
  652. },
  653. goLogin(e) {
  654. uni.navigateTo({
  655. url: e
  656. })
  657. },
  658. //我的收益
  659. getAmount() {
  660. let data = {
  661. shopId: uni.getStorageSync('shopId')
  662. }
  663. this.$Request.get('/app/shop/shopEarnings', data).then((res) => {
  664. if (res.code == 0) {
  665. this.sumMoney = parseFloat(res.data.shopAllEarnings).toFixed(2) //累计余额
  666. this.dayMoney = parseFloat(res.data.shopEarningsDay).toFixed(2) //今日收益
  667. this.monthMoney = parseFloat(res.data.shopEarningsMonth).toFixed(2) //本月收益
  668. this.cashMoney = parseFloat(res.data.cashMoney).toFixed(2) //本月提现
  669. }
  670. })
  671. },
  672. getshanghuinfo() {
  673. let data = {
  674. shopId: uni.getStorageSync('shopId')
  675. }
  676. this.$Request.get('/app/shop/selectShopMessage', data).then((res) => {
  677. if (res.code == 0) {
  678. uni.setStorageSync('cashDeposit', res.data.cashDeposit)
  679. }
  680. })
  681. },
  682. selectShop(e) {
  683. this.shop = e
  684. this.show = false
  685. },
  686. goNav(url) {
  687. if (this.shopToken) {
  688. // #ifdef MP-WEIXIN
  689. if (uni.getStorageSync('sendindexMsg')) {
  690. uni.requestSubscribeMessage({
  691. tmplIds: this.arr,
  692. success(re) {
  693. // console.log(re,'**********')
  694. var datas = JSON.stringify(re)
  695. if (datas.indexOf('accept') != -1) {
  696. console.log(re)
  697. }
  698. },
  699. fail: (res) => {
  700. console.log(res)
  701. }
  702. })
  703. }
  704. // #endif
  705. uni.navigateTo({
  706. url
  707. })
  708. } else {
  709. uni.navigateTo({
  710. url: '/pages/my/loginphone'
  711. })
  712. }
  713. },
  714. getUserInfo() {
  715. this.$Request.getA('/sys/user/info').then((res) => {
  716. console.log(res, 'ljh')
  717. if (res.code == 0) {
  718. this.shopName = res.user.shopList[0].shopName
  719. this.shopCover = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover : '../../static/logo.png'
  720. this.$queue.setData('avatar', res.user.shopList[0].shopCover)
  721. this.$queue.setData('userId', res.user.userId)
  722. this.$queue.setData('shopId', res.user.shopList[0].shopId)
  723. this.$queue.setData('mobile', res.user.mobile)
  724. this.$queue.setData('shopUserName', res.user.shopList[0].shopName)
  725. if (res.user.userEntity) {
  726. this.$queue.setData('zhiFuBao', res.user.userEntity.zhiFuBao)
  727. this.$queue.setData('zhiFuBaoName', res.user.userEntity.zhiFuBaoName)
  728. }
  729. }
  730. })
  731. },
  732. // switch切换回调
  733. switchChange(e) {
  734. let data = {
  735. shopId: uni.getStorageSync('shopId'),
  736. messageConfiguration: e.detail.value ? 0 : 1
  737. }
  738. this.$Request.postJson('/app/goods/updateGoodShop', data).then((res) => {
  739. if (res.code == 0) {
  740. uni.showToast({
  741. title: this.isChecked ? '关闭成功' : '开启成功',
  742. icon: 'none',
  743. mask: true
  744. })
  745. setTimeout(() => {
  746. this.getSetData()
  747. }, 1500)
  748. }
  749. })
  750. }
  751. }
  752. }
  753. </script>
  754. <style lang="scss">
  755. page {
  756. background-color: #f2f2f2;
  757. }
  758. .bg {
  759. background: #ffffff;
  760. }
  761. .camera {
  762. width: 54px;
  763. height: 44px;
  764. &:active {
  765. background-color: #ededed;
  766. }
  767. }
  768. .btn-bg {
  769. width: 64px;
  770. height: 28px;
  771. background: linear-gradient(90deg, #cda26e 0%, #dcb78a 100%);
  772. border-radius: 28px;
  773. text-align: center;
  774. line-height: 28px;
  775. margin-top: 4px;
  776. color: '#604320';
  777. }
  778. .images {
  779. width: 18rpx;
  780. height: 30rpx;
  781. }
  782. .dfs {
  783. display: flex;
  784. align-items: center;
  785. }
  786. .moneybox {
  787. width: 690upx;
  788. margin: 0 auto;
  789. // height: 369upx;
  790. // background: #2FB57A;
  791. border-radius: 20upx 20upx 20upx 20upx;
  792. }
  793. .btn {
  794. width: 160upx;
  795. height: 60upx;
  796. background: linear-gradient(90deg, #3d3734 0%, #252323 100%);
  797. border-radius: 50upx;
  798. text-align: center;
  799. line-height: 60upx;
  800. color: #ffffff;
  801. }
  802. .xflist {
  803. width: 150upx;
  804. height: 50upx;
  805. background: #211d2c;
  806. color: #ffffff;
  807. border-radius: 5upx;
  808. text-align: center;
  809. line-height: 50upx;
  810. }
  811. .erweima {
  812. background: #fcd202;
  813. padding: 5px 10px;
  814. border-radius: 20px;
  815. }
  816. .bott {
  817. background: red;
  818. color: #ffffff;
  819. width: 30upx;
  820. height: 30upx;
  821. text-align: center;
  822. line-height: 26upx;
  823. padding: 5rpx;
  824. border-radius: 60%;
  825. font-size: 23rpx;
  826. margin-right: 15rpx;
  827. }
  828. </style>