index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  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. messageConfiguration: '',
  315. timer: null,
  316. errCount: 0
  317. }
  318. },
  319. onLoad() {
  320. // this.messageCount = uni.getStorageSync('messageCount')
  321. this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
  322. this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
  323. this.userId = uni.getStorageSync('userId')
  324. this.open = uni.getStorageSync('open')
  325. this.$Request.getT('/app/common/type/354').then((res) => {
  326. //订单取消通知
  327. if (res.code == 0) {
  328. if (res.data && res.data.value) {
  329. this.arr.push(res.data.value)
  330. }
  331. }
  332. })
  333. this.$Request.getT('/app/common/type/353').then((res) => {
  334. //订单取消通知
  335. if (res.code == 0) {
  336. if (res.data && res.data.value) {
  337. this.arr.push(res.data.value)
  338. }
  339. }
  340. })
  341. this.$Request.getT('/app/common/type/352').then((res) => {
  342. //新订单通知
  343. if (res.code == 0) {
  344. if (res.data && res.data.value) {
  345. this.arr.push(res.data.value)
  346. }
  347. }
  348. })
  349. // let that= this
  350. // if (this.open = true) {
  351. // uni.showModal({
  352. // title: '提示',
  353. // content: '请先去完善店铺信息,上线店铺后同城外卖用户端首页展示您的店铺。',
  354. // success: function(res) {
  355. // if (res.confirm) {
  356. // console.log('用户点击确定');
  357. // that.open = false
  358. // that.$queue.setData("open", that.open);
  359. // } else if (res.cancel) {
  360. // console.log('用户点击取消');
  361. // that.open = false
  362. // that.$queue.setData("open", that.open);
  363. // }
  364. // }
  365. // })
  366. // }
  367. },
  368. onShow() {
  369. this.userId = uni.getStorageSync('userId')
  370. this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
  371. if (this.shopToken) {
  372. this.messageCount = uni.getStorageSync('messageCount')
  373. this.isLogin = false
  374. this.getUserInfo()
  375. this.getshanghuinfo()
  376. this.getAmount()
  377. } else {
  378. this.isLogin = true
  379. this.shopName = '匿名'
  380. this.shopCover = '../../static/logo.png'
  381. this.sumMoney = 0 //累计余额
  382. this.dayMoney = 0 //今日收益
  383. this.monthMoney = 0 //本月收益
  384. this.cashMoney = 0 //本月提现
  385. }
  386. if (this.userId) {
  387. this.getSetData()
  388. }
  389. },
  390. onHide() {
  391. if (this.timer) {
  392. clearInterval(this.timer)
  393. }
  394. },
  395. methods: {
  396. getSetData() {
  397. // 获取订阅消息配置
  398. let data = {
  399. shopId: uni.getStorageSync('shopId')
  400. }
  401. this.$Request.getT('/app/goods/selectGoodShop', data).then((res) => {
  402. // console.log(res, '888')
  403. if (res.code == 0) {
  404. if (res.data.messageConfiguration == 1) {
  405. this.isChecked = false
  406. } else {
  407. this.isChecked = true
  408. }
  409. this.messageConfiguration = res.data.messageConfiguration
  410. if (this.messageConfiguration == 0) {
  411. this.timer = setInterval(() => {
  412. // 订单消息提醒
  413. let data = {
  414. shopIds: this.$queue.getData('shopId')
  415. }
  416. this.$Request.post('/admin/ordermessage/selectReadFlagCount', data).then((res) => {
  417. console.log(res, '999')
  418. if (res.code === 0) {
  419. if (res.data > 0) {
  420. if (this.errCount != res.data) {
  421. this.errCount = res.data
  422. this.aplayAudio()
  423. uni.showModal({
  424. title: '消息',
  425. content: '有' + res.data + '条订单,请前往订单中心处理。',
  426. success: (ret) => {
  427. if (ret.confirm) {
  428. uni.switchTab({
  429. url: '/pages/order/index'
  430. })
  431. } else {
  432. console.log('else', ret)
  433. this.defineCallBack()
  434. }
  435. }
  436. })
  437. // this.chatNum = data.data
  438. }
  439. } else {
  440. this.errCount = 0
  441. }
  442. }
  443. })
  444. }, 10000)
  445. }
  446. }
  447. })
  448. },
  449. aplayAudio() {
  450. const innerAudioContext = uni.createInnerAudioContext()
  451. innerAudioContext.autoplay = true
  452. innerAudioContext.src = 'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3'
  453. innerAudioContext.onPlay(() => {
  454. console.log('开始播放')
  455. })
  456. innerAudioContext.onError((res) => {
  457. console.log(res.errMsg)
  458. console.log(res.errCode)
  459. })
  460. },
  461. defineCallBack() {
  462. let data = {
  463. shopIds: this.$queue.getData('shopId')
  464. }
  465. this.$Request.post('/admin/ordermessage/allcheckOrderMessage', data).then((res) => {
  466. if (res.code === 0) {
  467. this.errCount = 0
  468. }
  469. })
  470. },
  471. previewImage() {
  472. var arr = []
  473. arr.push(this.shopQrImg)
  474. //uniapp预览轮播图方法
  475. uni.previewImage({
  476. current: 0, //预览图片的下标
  477. urls: arr //预览图片的地址,必须要数组形式
  478. })
  479. },
  480. //跳转设置
  481. goset() {
  482. uni.navigateTo({
  483. url: '/my/other/set'
  484. })
  485. },
  486. //生成二维码
  487. shopQr() {
  488. // uni.showLoading({
  489. // title: '二维码生成中',
  490. // duration: 1000,
  491. // icon: 'none'
  492. // });
  493. this.show = true
  494. // var data={
  495. // shopId:uni.getStorageSync('shopId')
  496. // }
  497. // this.$Request.get("/invite/shopQr",data).then(res => {
  498. // if (res.code == 0) {
  499. // console.log(res,'oooo')
  500. // this.checked = res.data.isSendMsg == null || res.data.isSendMsg == 1 ? true : false
  501. // }
  502. // });
  503. var shopid = urlSafeBase64Encode(encrypt(uni.getStorageSync('shopId').toString()))
  504. this.shopQrImg = configurl.APIHOSTsss + '/sqx_fast/invite/shopQr?shopId=' + shopid
  505. console.log(this.shopQrImg, 'oooo')
  506. },
  507. //跳转用户端
  508. gouser() {
  509. wx.navigateToMiniProgram({
  510. appId: 'wx45ab46867002aa0b',
  511. path: '/pages/index/index',
  512. envVersion: 'release', // 打开正式版
  513. success(res) {
  514. // 打开成功
  515. },
  516. fail: function (err) {
  517. console.log(err)
  518. }
  519. })
  520. },
  521. //跳转供货商
  522. goGong() {
  523. wx.navigateToMiniProgram({
  524. appId: 'wx45ab46867002aa0b',
  525. path: '/pages/index/shopList/indexShop',
  526. envVersion: 'release', // 打开正式版release
  527. success(res) {
  528. // 打开成功
  529. },
  530. fail: function (err) {
  531. console.log(err)
  532. }
  533. })
  534. },
  535. goQian() {
  536. if (this.shopToken) {
  537. // #ifdef MP-WEIXIN
  538. if (uni.getStorageSync('sendindexMsg')) {
  539. uni.requestSubscribeMessage({
  540. tmplIds: this.arr,
  541. success(re) {
  542. // console.log(re,'**********')
  543. var datas = JSON.stringify(re)
  544. if (datas.indexOf('accept') != -1) {
  545. console.log(re)
  546. }
  547. },
  548. fail: (res) => {
  549. console.log(res)
  550. }
  551. })
  552. }
  553. // #endif
  554. uni.navigateTo({
  555. url: '/my/other/wallet'
  556. })
  557. } else {
  558. uni.showModal({
  559. title: '提示',
  560. content: '您还未登录,请先登录',
  561. success: function (res) {
  562. if (res.confirm) {
  563. console.log('用户点击确定')
  564. uni.navigateTo({
  565. url: '/pages/my/loginphone'
  566. })
  567. } else if (res.cancel) {
  568. console.log('用户点击取消')
  569. }
  570. }
  571. })
  572. }
  573. },
  574. bindFb() {
  575. let renzheng = uni.getStorageSync('renzheng')
  576. console.log(this.userId, renzheng)
  577. if (this.shopToken) {
  578. // #ifdef MP-WEIXIN
  579. if (uni.getStorageSync('sendindexMsg')) {
  580. uni.requestSubscribeMessage({
  581. tmplIds: this.arr,
  582. success(re) {
  583. // console.log(re,'**********')
  584. var datas = JSON.stringify(re)
  585. if (datas.indexOf('accept') != -1) {
  586. console.log(re)
  587. }
  588. },
  589. fail: (res) => {
  590. console.log(res)
  591. }
  592. })
  593. }
  594. // #endif
  595. uni.navigateTo({
  596. url: '/my/publish/editor'
  597. })
  598. } else {
  599. uni.showModal({
  600. title: '提示',
  601. content: '您还未登录,请先登录',
  602. success: function (res) {
  603. if (res.confirm) {
  604. console.log('用户点击确定')
  605. uni.navigateTo({
  606. url: '/pages/my/loginphone'
  607. })
  608. } else if (res.cancel) {
  609. console.log('用户点击取消')
  610. }
  611. }
  612. })
  613. }
  614. },
  615. goOrder() {
  616. uni.switchTab({
  617. url: '/pages/order/index'
  618. })
  619. },
  620. //列表跳转
  621. goNav(e, name) {
  622. console.log(e)
  623. if (this.shopToken) {
  624. // #ifdef MP-WEIXIN
  625. if (uni.getStorageSync('sendindexMsg')) {
  626. uni.requestSubscribeMessage({
  627. tmplIds: this.arr,
  628. success(re) {
  629. // console.log(re,'**********')
  630. var datas = JSON.stringify(re)
  631. if (datas.indexOf('accept') != -1) {
  632. console.log(re)
  633. }
  634. },
  635. fail: (res) => {
  636. console.log(res)
  637. }
  638. })
  639. }
  640. // #endif
  641. uni.navigateTo({
  642. url: e
  643. })
  644. } else {
  645. uni.showModal({
  646. title: '提示',
  647. content: '您还未登录,请先登录',
  648. success: function (res) {
  649. if (res.confirm) {
  650. console.log('用户点击确定')
  651. uni.navigateTo({
  652. url: '/pages/my/loginphone'
  653. })
  654. } else if (res.cancel) {
  655. console.log('用户点击取消')
  656. }
  657. }
  658. })
  659. }
  660. },
  661. //列表跳转
  662. goNavs(e, name) {
  663. console.log(e)
  664. let cashDeposit = uni.getStorageSync('cashDeposit')
  665. if (this.shopToken) {
  666. // #ifdef MP-WEIXIN
  667. if (uni.getStorageSync('sendindexMsg')) {
  668. uni.requestSubscribeMessage({
  669. tmplIds: this.arr,
  670. success(re) {
  671. // console.log(re,'**********')
  672. var datas = JSON.stringify(re)
  673. if (datas.indexOf('accept') != -1) {
  674. console.log(re)
  675. }
  676. },
  677. fail: (res) => {
  678. console.log(res)
  679. }
  680. })
  681. }
  682. // #endif
  683. if (cashDeposit == 0 || cashDeposit == 'null') {
  684. uni.showModal({
  685. title: '提示',
  686. content: '您还未缴纳保证金,请先去缴纳保证金',
  687. success: function (res) {
  688. if (res.confirm) {
  689. console.log('用户点击确定')
  690. uni.navigateTo({
  691. url: '/my/other/money'
  692. })
  693. } else if (res.cancel) {
  694. console.log('用户点击取消')
  695. }
  696. }
  697. })
  698. } else {
  699. uni.navigateTo({
  700. url: e
  701. })
  702. }
  703. } else {
  704. uni.showModal({
  705. title: '提示',
  706. content: '您还未登录,请先登录',
  707. success: function (res) {
  708. if (res.confirm) {
  709. console.log('用户点击确定')
  710. uni.navigateTo({
  711. url: '/pages/my/loginphone'
  712. })
  713. } else if (res.cancel) {
  714. console.log('用户点击取消')
  715. }
  716. }
  717. })
  718. }
  719. },
  720. goLogin(e) {
  721. uni.navigateTo({
  722. url: e
  723. })
  724. },
  725. //我的收益
  726. getAmount() {
  727. let data = {
  728. shopId: uni.getStorageSync('shopId')
  729. }
  730. this.$Request.get('/app/shop/shopEarnings', data).then((res) => {
  731. if (res.code == 0) {
  732. this.sumMoney = parseFloat(res.data.shopAllEarnings).toFixed(2) //累计余额
  733. this.dayMoney = parseFloat(res.data.shopEarningsDay).toFixed(2) //今日收益
  734. this.monthMoney = parseFloat(res.data.shopEarningsMonth).toFixed(2) //本月收益
  735. this.cashMoney = parseFloat(res.data.cashMoney).toFixed(2) //本月提现
  736. }
  737. })
  738. },
  739. getshanghuinfo() {
  740. let data = {
  741. shopId: uni.getStorageSync('shopId')
  742. }
  743. this.$Request.get('/app/shop/selectShopMessage', data).then((res) => {
  744. if (res.code == 0) {
  745. uni.setStorageSync('cashDeposit', res.data.cashDeposit)
  746. }
  747. })
  748. },
  749. selectShop(e) {
  750. this.shop = e
  751. this.show = false
  752. },
  753. goNav(url) {
  754. if (this.shopToken) {
  755. // #ifdef MP-WEIXIN
  756. if (uni.getStorageSync('sendindexMsg')) {
  757. uni.requestSubscribeMessage({
  758. tmplIds: this.arr,
  759. success(re) {
  760. // console.log(re,'**********')
  761. var datas = JSON.stringify(re)
  762. if (datas.indexOf('accept') != -1) {
  763. console.log(re)
  764. }
  765. },
  766. fail: (res) => {
  767. console.log(res)
  768. }
  769. })
  770. }
  771. // #endif
  772. uni.navigateTo({
  773. url
  774. })
  775. } else {
  776. uni.navigateTo({
  777. url: '/pages/my/loginphone'
  778. })
  779. }
  780. },
  781. getUserInfo() {
  782. this.$Request.getA('/sys/user/info').then((res) => {
  783. console.log(res, 'ljh')
  784. if (res.code == 0) {
  785. this.shopName = res.user.shopList[0].shopName
  786. this.shopCover = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover : '../../static/logo.png'
  787. this.$queue.setData('avatar', res.user.shopList[0].shopCover)
  788. this.$queue.setData('userId', res.user.userId)
  789. this.$queue.setData('shopId', res.user.shopList[0].shopId)
  790. this.$queue.setData('mobile', res.user.mobile)
  791. this.$queue.setData('shopUserName', res.user.shopList[0].shopName)
  792. if (res.user.userEntity) {
  793. this.$queue.setData('zhiFuBao', res.user.userEntity.zhiFuBao)
  794. this.$queue.setData('zhiFuBaoName', res.user.userEntity.zhiFuBaoName)
  795. }
  796. }
  797. })
  798. },
  799. // switch切换回调
  800. switchChange(e) {
  801. let data = {
  802. shopId: uni.getStorageSync('shopId'),
  803. messageConfiguration: e.detail.value ? 0 : 1
  804. }
  805. this.$Request.postJson('/app/goods/updateGoodShop', data).then((res) => {
  806. if (res.code == 0) {
  807. uni.showToast({
  808. title: this.isChecked ? '关闭成功' : '开启成功',
  809. icon: 'none',
  810. mask: true
  811. })
  812. setTimeout(() => {
  813. if (this.timer) {
  814. clearInterval(this.timer)
  815. }
  816. this.getSetData()
  817. }, 1500)
  818. }
  819. })
  820. }
  821. }
  822. }
  823. </script>
  824. <style lang="scss">
  825. page {
  826. background-color: #f2f2f2;
  827. }
  828. .bg {
  829. background: #ffffff;
  830. }
  831. .camera {
  832. width: 54px;
  833. height: 44px;
  834. &:active {
  835. background-color: #ededed;
  836. }
  837. }
  838. .btn-bg {
  839. width: 64px;
  840. height: 28px;
  841. background: linear-gradient(90deg, #cda26e 0%, #dcb78a 100%);
  842. border-radius: 28px;
  843. text-align: center;
  844. line-height: 28px;
  845. margin-top: 4px;
  846. color: '#604320';
  847. }
  848. .images {
  849. width: 18rpx;
  850. height: 30rpx;
  851. }
  852. .dfs {
  853. display: flex;
  854. align-items: center;
  855. }
  856. .moneybox {
  857. width: 690upx;
  858. margin: 0 auto;
  859. // height: 369upx;
  860. // background: #2FB57A;
  861. border-radius: 20upx 20upx 20upx 20upx;
  862. }
  863. .btn {
  864. width: 160upx;
  865. height: 60upx;
  866. background: linear-gradient(90deg, #3d3734 0%, #252323 100%);
  867. border-radius: 50upx;
  868. text-align: center;
  869. line-height: 60upx;
  870. color: #ffffff;
  871. }
  872. .xflist {
  873. width: 150upx;
  874. height: 50upx;
  875. background: #211d2c;
  876. color: #ffffff;
  877. border-radius: 5upx;
  878. text-align: center;
  879. line-height: 50upx;
  880. }
  881. .erweima {
  882. background: #fcd202;
  883. padding: 5px 10px;
  884. border-radius: 20px;
  885. }
  886. .bott {
  887. background: red;
  888. color: #ffffff;
  889. width: 30upx;
  890. height: 30upx;
  891. text-align: center;
  892. line-height: 26upx;
  893. padding: 5rpx;
  894. border-radius: 60%;
  895. font-size: 23rpx;
  896. margin-right: 15rpx;
  897. }
  898. </style>