index.vue 28 KB

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