index.vue 28 KB

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