index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <template>
  2. <view style="padding-bottom: 80upx">
  3. <view class="u-flex padding-lr bg padding-top">
  4. <view class="u-m-r-10">
  5. <image :src="avatar" style="width: 100rpx; height: 100rpx; border-radius: 100rpx" @click="goNav('/my/store/index')"></image>
  6. </view>
  7. <view class="u-flex-1 u-m-l-10" v-if="!isLogin">
  8. <view class="u-font-18 text-bold">
  9. <view class="margin-left-sm margin-top-xs">
  10. <view class="flex align-end" style="display: flex; align-items: center">
  11. {{ userName }}
  12. <view class="status" v-if="shop" @click="changePutaWayFlag">
  13. <image
  14. :src="shop.putawayFlag == 0 ? '../../static/images/index/shangban.png' : '../../static/images/index/dayang.png'"
  15. style="width: 54rpx; height: 54rpx"
  16. ></image>
  17. {{ shop.putawayFlag == 0 ? '营业' : '关门' }}
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">登录</view>
  24. </view>
  25. <view class="flex align-center padding-left">
  26. <image src="../../static/images/img/data.png" style="width: 26upx; height: 26upx"></image>
  27. <view class="margin-left-xs flex align-center" style="color: #999999">
  28. <view @click="bindData(1)">{{ startTime ? startTime : '开始时间' }}</view>
  29. <view @click="bindData(2)">{{ endTime ? endTime : '结束时间' }}</view>
  30. </view>
  31. </view>
  32. <view class="flex align-center box justify-between text-center">
  33. <view @click="goNav('/my/other/cashList')">
  34. <text class="text-bold text-xl">{{ allMoney ? allMoney : '0' }}</text>
  35. <view>总收益</view>
  36. </view>
  37. <view class="">
  38. <text class="text-bold text-xl">{{ allCount ? allCount : '0' }}</text>
  39. <view>总销量</view>
  40. </view>
  41. <view @click="goNav('/my/store/pingjia')">
  42. <text class="text-bold text-xl">{{ countTakingByUserId ? countTakingByUserId : '0' }}</text>
  43. <view>用户评价</view>
  44. </view>
  45. <!-- <view class="">
  46. <text class="text-bold text-xl">{{putaway+soldOut}}</text>
  47. <view>用户发布</view>
  48. </view> -->
  49. </view>
  50. <view class="padding">
  51. <view class="text-bold text-lg margin-bottom-sm">订单数据</view>
  52. <view class="orderbox">
  53. <view class="">
  54. <text class="text-bold text-xl">{{ orderMoney ? orderMoney : '0' }}</text>
  55. <view class="margin-top-xs">订单收入</view>
  56. </view>
  57. <view class="">
  58. <text class="text-bold text-xl">{{ sumCountOrder ? sumCountOrder : '0' }}</text>
  59. <view class="margin-top-xs">总订单数</view>
  60. </view>
  61. <view class="">
  62. <text class="text-bold text-xl">{{ refundMoney ? refundMoney : '0' }}</text>
  63. <view class="margin-top-xs">退款金额</view>
  64. </view>
  65. <view class="">
  66. <text class="text-bold text-xl">{{ countByUserId ? countByUserId : '0' }}</text>
  67. <view class="margin-top-xs">访客人数</view>
  68. </view>
  69. </view>
  70. </view>
  71. <view style="padding: 0upx 30upx">
  72. <view class="text-bold text-lg margin-bottom-sm flex justify-between">
  73. <view>订单管理</view>
  74. <view @click="goDetail(1)">
  75. <text style="color: #666666; font-size: 26upx; margin-right: 10upx">查看全部</text>
  76. <image src="../../static/images/my/right.png" style="width: 12upx; height: 20upx"></image>
  77. </view>
  78. </view>
  79. <view class="orderbox">
  80. <!-- <view class="">
  81. <text class="text-bold text-xl">{{i1}}</text>
  82. <view class="margin-top-xs">待付款</view>
  83. </view> -->
  84. <view class="">
  85. <text class="text-bold text-xl">{{ i5 }}</text>
  86. <view class="margin-top-xs">待接单</view>
  87. </view>
  88. <view class="">
  89. <text class="text-bold text-xl">{{ i2 }}</text>
  90. <view class="margin-top-xs">制作中</view>
  91. </view>
  92. <view class="">
  93. <text class="text-bold text-xl">{{ i3 }}</text>
  94. <view class="margin-top-xs">待取餐</view>
  95. </view>
  96. <view class="">
  97. <text class="text-bold text-xl">{{ i4 }}</text>
  98. <view class="margin-top-xs">已完成</view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="padding">
  103. <view class="text-bold text-lg margin-bottom-sm flex justify-between">
  104. <view>我的商品</view>
  105. <view @click="goDetail(2)">
  106. <text style="color: #666666; font-size: 26upx; margin-right: 10upx">查看全部</text>
  107. <image src="../../static/images/my/right.png" style="width: 12upx; height: 20upx"></image>
  108. </view>
  109. </view>
  110. <view class="orderbox">
  111. <view class="">
  112. <text class="text-bold text-xl">{{ putawayCount }}</text>
  113. <view class="margin-top-sm">上架中</view>
  114. </view>
  115. <view class="">
  116. <text class="text-bold text-xl">{{ soldoutCount }}</text>
  117. <view class="margin-top-sm">已下架</view>
  118. </view>
  119. <view @click="bindFb()">
  120. <image src="../../static/images/index/add.png" style="width: 46upx; height: 46upx"></image>
  121. <view class="margin-top-xs">添加商品</view>
  122. </view>
  123. </view>
  124. </view>
  125. <u-popup v-model="Authorization" mode="center" close-icon="close-circle" close-icon-pos="top-right" close-icon-color="#8f9298" close-icon-size="50">
  126. <view class="contentview">
  127. <view class="title">隐私保护指引</view>
  128. <view class="des" @click="openPrivacyContract">
  129. 在使用当前小程序服务之前,请仔细阅读
  130. <text style="color: #ff7f00">{{ privacyContractName }}</text>
  131. 。如你同意{{ privacyContractName }},请点击“同意”开始使用。
  132. </view>
  133. <view class="btns">
  134. <button class="item reject" @click="exitMiniProgram">拒绝</button>
  135. <button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization" @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  136. </view>
  137. </view>
  138. </u-popup>
  139. <!-- 开始时间 -->
  140. <u-picker v-model="startshow" mode="time" :params="paramsStart" @confirm="startData"></u-picker>
  141. <!-- 结束时间 -->
  142. <u-picker v-model="endshow" mode="time" :params="paramsEnd" @confirm="endData"></u-picker>
  143. </view>
  144. </template>
  145. <script>
  146. import { encrypt, decrypt, urlSafeBase64Decode, urlSafeBase64Encode } from '@/utils/cryptojs.js'
  147. export default {
  148. data() {
  149. return {
  150. Authorization: false,
  151. privacyContractName: '',
  152. avatar: '../../static/logo.png',
  153. isLogin: true,
  154. userName: '匿名',
  155. startshow: false,
  156. endshow: false,
  157. paramsStart: {
  158. year: true,
  159. month: true,
  160. day: true,
  161. hour: false,
  162. minute: false,
  163. second: false
  164. },
  165. paramsEnd: {
  166. year: true,
  167. month: true,
  168. day: true,
  169. hour: false,
  170. minute: false,
  171. second: false
  172. },
  173. startTime: '',
  174. endTime: '',
  175. allMoney: 0, //总收益
  176. allCount: 0, //总销量
  177. countTakingByUserId: 0, //用户评价数
  178. orderMoney: 0, //订单收入
  179. sumCountOrder: 0, //总订单数
  180. refundMoney: 0, //退款金额
  181. countByUserId: 0, //访客人数
  182. i1: 0, //待付款
  183. i2: 0, //制作中
  184. i3: 0, //待取餐
  185. i4: 0, //已完成
  186. i5: 0, //商家待接单
  187. putawayCount: 0, //上架中
  188. soldoutCount: 0, //下架中
  189. page: 1,
  190. limit: 10,
  191. longitude: '',
  192. latitude: '',
  193. userId: '',
  194. shop: '',
  195. arr: [],
  196. errCount: 0
  197. }
  198. },
  199. onLoad() {
  200. // var acc =
  201. // 'RPX3_v1bTP4fLfrEMWHegBp_pJPh8TGDaN-SHZFjyyLqGa-M1P5IeNfVbwxsukpWmYVQnDU3hQz3dAT3wF-S58dfh0vXozVsynPq0q9mXA32nGETzt0VpJ4pbU1udcK8ia5M22RV2sF64vbGNxf9VuNTmIy3rqK-l3JwtbCGw94CcfTC6env4sMd35pkeTV2haSeHz3qGRc_TCf2yNewmyfPz_Z11Jmhe_PzAND9IkqT3KBo9JusvkFlR9MfelT9IJHHylGHEu60OIBf2rsQZmkJRwbBiDw_i1yawM2aJRVs9u0CB1nCtjh4Ce_VyJomDK9qrnrwwsGuwGOdxvTdE56oDK-vbigd7ui4Q1t-qrspkZaOvFqs9xX0ye9CVB3vPBxkVjV5vK84jyUZzzWBnn93SzyS5pTl1WfR8AQx_TEg-YE9B4i0A-R8yp3syXGR4piK5faFAnmYTc9sHYDPLjahe1Fkd0SpLTMD3ELa_eObMHmvRe7oKVjBUg6oDGtw-pi1y-WbzD3yW6fGZugXulmUHDVHuXVhL4dTYqwK_iVmHJhCmX81lgETrqgsScvyK5KM-2SJD8ftrLuuewWqwO0O5sBPxQ9T2fG-Sm0JcBN3_J1A9dLo-aQtY7IZW1cNj7gSDsSAEPUAc8gTgyqVeAM6_ftzuN7EzPcIau7979js0hoblrHa8kZFvJgRzilBnH2xOPTbHCLhXsvwErGGyQ5WHo7xSmFUyvsPGWLJXJqBsq7j9X9pYa-uRpFwbJPgV_ylSuTIkoxdpqe8tmIP3dWIyngschDIh8Y9XCJNQO0yaZMkdfmV-DU0TX2duJSg9B6lZ51ZwBJ_aBjtTOJnlL3CGwPDj3WFACm28lSjczfjrmQcnIhTiNl8RY1RKzbuWL700QsNreGkoZ_W-m7udFw-J_ed9iJBaAGfVzAMmGXp9hEKZI4n9nXAUCQdDCC5gxc16MM9b8aCGfcbA4Ht4cT4xXj7GuNXbXDwtIPyzu_mdv7y8aXKCwExrMIaplK6RUlZHeBp0Be8rlWJXz3xcd6sJ28js6aUcn61NzZked9pYHDT62edeiabT3z0J-iAnEhmZgT1LNtg7qt3tluulNaRzeoIK5X2JS71JRcM_-QuukajDC1OKja4GDzIDoW0huJYxJsEb0qn924_9ixc8yGYCzVG4swn_Tj5SMhLXgt44aGETdQa5SiSKuG3kuUiYpPnJ0vjNm5BjcSfL1CyI-Xp2S_QGKB6HQkwbLW7fuL_sI82iJUAtLOJrLnKCpPDm-v_yF3G3L7nDtRtoIxsaTLxVB-jErUK5WGWi3dAJXdvlLhRAL3MYnTdQret94G9jXvQtA7vv656AV-5DHSWBIwtnn-KDrtwQaiauR6459Y86vFBEAD873Fslo6O8ffO2D3qD6DPbVguN3gbMpD-X2rNlbdAOVHWI6x5mZOi8RS6BAp_yTXFweKJeWicVTo7s3UiuvYLbszQSWsbVMppN1AgzKiyshVentFYJdvRc2ZL7g1KcYtdQgx2FGFjYN2uE7PuU8WbpKzmZpmwZheHZjnbVnVg_SIC0NU9R0ji-61dqe_DT7r4hjNI-1msDiOHvrVNF0UJGGfq8DXob6UYkVoSX2R7z4N3Kg6iXJ83nGFjyO2XNky2KtsrlDrIB3gpqn4TzRh9-UmQRTGFCfx_02pKvTbRId08khAh7Xs9BypBrtcls9bFsvgVRdWCgEGX7OpX9sXh5z4NbBtPOlIn4-xBoXFUV53M04mwoh0N9RLoLQKAt0VD3bhMTK0ApRDh09RfOqVJaXkdwTtGBbNeJMrvibtbjiYnhf8aGrmyX6eN-huJlkXkTMB6eZmRyiLKEdO-gtXCRJQsCorPWyrT4EgnW0JL8z8A5skxBfvcoMScC0Mtd9Vk9wYxLXvKO6VXrZyvNon7juCwlck7qtwqojWZ6vf39aZsLhS-UNXJKmucj_Y7I9iwRNZtoDYOrWTiyRq4nOAmpQDqpMxJlfzM2HSFd-JNqGEIcYt7iHNsNJdUZZ_iuM0yGHY8dTaw8zhMY-TI5H2hG5UCKvnxE0cBXCqZHzO0RcEM7WzMRxgGq_4a4Hg949gv07OS8CbscyG_YqyF1Tvy08YyT0-jW2dkLkJ2v2NZv0PxXs4XK8PaPkXidCxiNVHrBQPwjkgSMa8SARzfwmaM5BDeM1Ww4h_unHitp5If6I-oHKIlsJ-PzGqCg6mowKjSP4yfQfYa_BMc29bXsfzOR9xGNGvREm4WvcuzDHNlInJxKwJTTE0tQ0kdG-t6za5-Ix5Hk-oi3PfZPO7T3jcYSMe8KrKYmQnjCkvL3V4M511EljXF1uEgdVGnmmmsMYhfB7fgj6gM-OAdgsNacB5Wn-ti_dMF0PHIyHtdRtpHGjruxahaa-NKIFYDk5AX59aZbwfNfXNQsbiDBrMEGMZy3g5d40W9Le_PGxOKAw4IISvkbePFA3Zd5gqC0RXCjhjwuHLaAS9NxTDDAPZj7TKu7j3qNLRBQhQibnWJoNDxpi1a439uI4byCqwnNMd13uKuwoJdjsOEqi8ZNcACjFna9YAMsy5yFKB61BrguxPt-fIUS7I4enmxL73dfSFkts9e6KJCpA2B5oIaJTCz-gtixD2vBG1MMej9Xm6ND-zAJbHW5CzfFCYVXrMhs-0wVqCbEoPbc12Iyp6VVnqF9b7QVBnPElYWZkOHWaDR5w1U7asg2ezj7P2zk38jN5NvtziYqSzcwY2naryNZmtq5YhfXv87bjVtWtbrI07XcBqAs90L9qLdKWbBzGo='
  202. console.log('加密ww', urlSafeBase64Encode(encrypt('1')))
  203. console.log('解密',decrypt(urlSafeBase64Decode('RnmM9Lfr_f0bCsUbdWOYRT20lNStqGNuOsC-8mdHxL3PwJhB8i1_l9nJaslFxYrE3W7noKXVqmbHRlvRqmynBQ==')),'ll')
  204. this.userId = uni.getStorageSync('userId')
  205. if (this.userId) {
  206. this.getFb()
  207. }
  208. this.$Request.getT('/app/common/type/354').then((res) => {
  209. //订单取消通知
  210. if (res.code == 0) {
  211. if (res.data && res.data.value) {
  212. this.arr.push(res.data.value)
  213. }
  214. }
  215. })
  216. this.$Request.getT('/app/common/type/353').then((res) => {
  217. //订单取消通知
  218. if (res.code == 0) {
  219. if (res.data && res.data.value) {
  220. this.arr.push(res.data.value)
  221. }
  222. }
  223. })
  224. this.$Request.getT('/app/common/type/352').then((res) => {
  225. //新订单通知
  226. if (res.code == 0) {
  227. if (res.data && res.data.value) {
  228. this.arr.push(res.data.value)
  229. }
  230. }
  231. })
  232. // #ifdef MP-WEIXIN
  233. try {
  234. let that = this
  235. wx.getPrivacySetting({
  236. success: (res) => {
  237. console.log('是否需要授权:', res.needAuthorization, '隐私协议的名称为:', res.privacyContractName)
  238. if (res.needAuthorization) {
  239. that.privacyContractName = res.privacyContractName
  240. // this.$refs.popusAuthorization.open();
  241. that.Authorization = true
  242. }
  243. },
  244. fail: () => {},
  245. complete: () => {}
  246. })
  247. } catch (e) {
  248. //TODO handle the exception
  249. }
  250. // #endif
  251. },
  252. onShow() {
  253. this.userId = uni.getStorageSync('userId')
  254. if (this.userId) {
  255. this.isLogin = false
  256. this.getUserInfo()
  257. this.getFb()
  258. // this.getTodayOrder()
  259. this.getcity()
  260. this.getShopInfo()
  261. // #ifdef MP-WEIXIN
  262. //订阅
  263. if (!uni.getStorageSync('sendindexMsg')) {
  264. this.openMsg()
  265. }
  266. // #endif
  267. } else {
  268. this.isLogin = true
  269. // this.userName = '匿名'
  270. this.avatar = '../../static/logo.png'
  271. this.allMoney = 0 //总收益
  272. this.putawayCount = 0 //上架中
  273. this.soldoutCount = 0 //下架中
  274. this.allCount = 0 //总销量
  275. this.countTakingByUserId = 0 //用户评价
  276. this.orderMoney = 0 //订单收入
  277. this.sumCountOrder = 0 //总订单数
  278. this.refundMoney = 0 //退款金额
  279. this.countByUserId = 0 //访客人数
  280. this.i1 = 0 //待付款
  281. this.i3 = 0 //待取餐
  282. this.i2 = 0 //制作中
  283. this.i4 = 0 //已完成
  284. this.i5 = 0 //商家待接单
  285. }
  286. let that = this
  287. if (that.userId) {
  288. setInterval(function () {
  289. // 订单消息提醒
  290. // newsSelect() {
  291. let data = {
  292. shopIds: that.$queue.getData('shopId')
  293. }
  294. that.$Request.post('/admin/ordermessage/selectReadFlagCount', data).then((res) => {
  295. if (res.code === 0) {
  296. // that.errCount = res.data
  297. if (res.data > 0) {
  298. if (that.errCount != res.data) {
  299. that.errCount = res.data
  300. that.aplayAudio()
  301. uni.showModal({
  302. title: '消息',
  303. content: '有' + res.data + '条订单,请前往订单中心处理。',
  304. success: (ret) => {
  305. if (ret.confirm) {
  306. uni.switchTab({
  307. url: '/pages/order/index'
  308. })
  309. } else {
  310. console.log('else', ret)
  311. that.defineCallBack()
  312. }
  313. }
  314. })
  315. // this.chatNum = data.data
  316. }
  317. } else {
  318. that.errCount = 0
  319. }
  320. }
  321. })
  322. }, 10000)
  323. }
  324. },
  325. methods: {
  326. // 打开隐私协议页面
  327. openPrivacyContract() {
  328. let that = this
  329. wx.openPrivacyContract({
  330. fail: () => {
  331. that.$queue.showToast('遇到错误无法打开!')
  332. }
  333. })
  334. },
  335. // 拒绝隐私协议
  336. exitMiniProgram() {
  337. // 直接退出小程序
  338. wx.exitMiniProgram()
  339. },
  340. // 同意隐私协议
  341. handleAgreePrivacyAuthorization() {
  342. this.Authorization = false
  343. },
  344. openMsg() {
  345. var that = this
  346. wx.getSetting({
  347. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  348. success(ret) {
  349. if (ret.subscriptionsSetting.itemSettings) {
  350. uni.setStorageSync('sendindexMsg', true)
  351. uni.openSetting({
  352. // 打开设置页
  353. success(rea) {
  354. console.log(rea.authSetting)
  355. }
  356. })
  357. } else {
  358. // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  359. uni.setStorageSync('sendindexMsg', false)
  360. uni.showModal({
  361. title: '提示',
  362. content: '为了更好的体验,请绑定消息推送',
  363. confirmText: '确定',
  364. cancelText: '取消',
  365. success: function (res) {
  366. if (res.confirm) {
  367. uni.requestSubscribeMessage({
  368. tmplIds: that.arr,
  369. success(re) {
  370. // console.log(re,'**********')
  371. var datas = JSON.stringify(re)
  372. if (datas.indexOf('accept') != -1) {
  373. console.log(re)
  374. }
  375. },
  376. fail: (res) => {
  377. console.log(res)
  378. }
  379. })
  380. that.showModal = false
  381. } else if (res.cancel) {
  382. that.showModal = true
  383. }
  384. }
  385. })
  386. }
  387. }
  388. })
  389. },
  390. //切换店铺状态
  391. changePutaWayFlag() {
  392. if (this.shop.putawayFlag == 0) {
  393. uni.showModal({
  394. title: '提示',
  395. content: '确定要打烊了吗?',
  396. showCancel: true,
  397. cancelText: '取消',
  398. confirmText: '确定',
  399. success: (res) => {
  400. if (res.confirm) {
  401. this.shop.putawayFlag = 1
  402. this.updateShopInfo()
  403. }
  404. },
  405. fail: () => {},
  406. complete: () => {}
  407. })
  408. } else {
  409. this.shop.putawayFlag = 0
  410. this.updateShopInfo()
  411. }
  412. },
  413. updateShopInfo() {
  414. this.$Request.postJsonA('/app/shop/updateShopMessage', this.shop).then((res) => {
  415. if (res.code == 0) {
  416. this.getShopInfo()
  417. } else {
  418. // this.shop.putawayFlag = 1
  419. uni.showModal({
  420. title: '提示',
  421. content: res.msg,
  422. success: function (res) {
  423. if (res.confirm) {
  424. } else if (res.cancel) {
  425. }
  426. }
  427. })
  428. this.getShopInfo()
  429. }
  430. })
  431. },
  432. getShopInfo() {
  433. if (this.$queue.getData('shopId')) {
  434. let data = {
  435. shopId: this.$queue.getData('shopId')
  436. }
  437. this.$Request.getA('/app/shop/selectShopMessage', data).then((res) => {
  438. if (res.code == 0) {
  439. uni.hideLoading()
  440. this.shop = res.data
  441. }
  442. })
  443. }
  444. },
  445. aplayAudio() {
  446. // const audio = document.getElementById('audio')
  447. // audio.play()
  448. // console.log('语音提示')
  449. const innerAudioContext = uni.createInnerAudioContext()
  450. innerAudioContext.autoplay = true
  451. // innerAudioContext.src ='../../static/mpc/order.mp3';
  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 that = this
  463. let data = {
  464. shopIds: that.$queue.getData('shopId')
  465. }
  466. that.$Request.post('/admin/ordermessage/allcheckOrderMessage', data).then((res) => {
  467. if (res.code === 0) {
  468. that.errCount = 0
  469. }
  470. })
  471. },
  472. getcity() {
  473. let that = this
  474. uni.getLocation({
  475. type: 'wgs84',
  476. success: function (res) {
  477. // console.log('当前位置的经度:' + res.longitude);
  478. // console.log('当前位置的纬度:' + res.latitude);
  479. that.latitude = res.latitude
  480. that.longitude = res.longitude
  481. }
  482. })
  483. },
  484. //获取用户发布
  485. getFb() {
  486. let data = {
  487. startTime: this.startTime,
  488. endTime: this.endTime,
  489. shopId: this.$queue.getData('shopId')
  490. }
  491. this.$Request.getA('/app/shop/shopHomePage', data).then((res) => {
  492. if (res.code == 0) {
  493. this.allMoney = res.data.allMoney //总收益
  494. this.putawayCount = res.data.putawayCount //上架中
  495. this.soldoutCount = res.data.soldoutCount //下架中
  496. this.allCount = res.data.allCount //总销量
  497. this.countTakingByUserId = res.data.countTakingByUserId //用户评价
  498. this.orderMoney = res.data.orderMoney //订单收入
  499. this.sumCountOrder = res.data.sumCountOrder //总订单数
  500. this.refundMoney = res.data.refundMoney //退款金额
  501. this.countByUserId = res.data.countByUserId //访客人数
  502. this.i1 = res.data.i1 //待付款
  503. this.i3 = res.data.i3 //待取餐
  504. this.i2 = res.data.i2 //制作中
  505. this.i4 = res.data.i4 //已完成
  506. this.i5 = res.data.i5 //商家待接单
  507. }
  508. })
  509. },
  510. goDetail(index) {
  511. // #ifdef MP-WEIXIN
  512. if (uni.getStorageSync('sendindexMsg')) {
  513. uni.requestSubscribeMessage({
  514. tmplIds: this.arr,
  515. success(re) {
  516. // console.log(re,'**********')
  517. var datas = JSON.stringify(re)
  518. if (datas.indexOf('accept') != -1) {
  519. console.log(re)
  520. }
  521. },
  522. fail: (res) => {
  523. console.log(res)
  524. }
  525. })
  526. }
  527. // #endif
  528. if (index == 1) {
  529. uni.switchTab({
  530. url: '/pages/order/index'
  531. })
  532. } else if (index == 2) {
  533. uni.navigateTo({
  534. url: '/my/store/addgood'
  535. })
  536. }
  537. },
  538. bindFb() {
  539. let userId = uni.getStorageSync('userId')
  540. if (userId) {
  541. uni.navigateTo({
  542. url: '/my/publish/goods'
  543. })
  544. } else {
  545. uni.showModal({
  546. title: '提示',
  547. content: '您还未登录,请先登录',
  548. success: function (res) {
  549. if (res.confirm) {
  550. // console.log('用户点击确定');
  551. uni.navigateTo({
  552. url: '/pages/my/loginphone'
  553. })
  554. } else if (res.cancel) {
  555. // console.log('用户点击取消');
  556. }
  557. }
  558. })
  559. }
  560. },
  561. //时间弹框开关
  562. bindData(index) {
  563. if (index == 1) {
  564. this.startshow = true
  565. } else if (index == 2) {
  566. this.endshow = true
  567. }
  568. },
  569. //开始时间
  570. startData(e) {
  571. this.startTime = e.year + '-' + e.month + '-' + e.day
  572. },
  573. // 结束时间
  574. endData(e) {
  575. this.endTime = e.year + '-' + e.month + '-' + e.day
  576. this.getFb()
  577. },
  578. goNav(e, name) {
  579. if (this.userId) {
  580. // #ifdef MP-WEIXIN
  581. if (uni.getStorageSync('sendindexMsg')) {
  582. uni.requestSubscribeMessage({
  583. tmplIds: this.arr,
  584. success(re) {
  585. // console.log(re,'**********')
  586. var datas = JSON.stringify(re)
  587. if (datas.indexOf('accept') != -1) {
  588. console.log(re)
  589. }
  590. },
  591. fail: (res) => {
  592. console.log(res)
  593. }
  594. })
  595. }
  596. // #endif
  597. uni.navigateTo({
  598. url: e
  599. })
  600. } else {
  601. uni.showModal({
  602. title: '提示',
  603. content: '您还未登录,请先登录',
  604. success: function (res) {
  605. if (res.confirm) {
  606. console.log('用户点击确定')
  607. uni.navigateTo({
  608. url: '/pages/my/loginphone'
  609. })
  610. } else if (res.cancel) {
  611. console.log('用户点击取消')
  612. }
  613. }
  614. })
  615. }
  616. },
  617. getUserInfo() {
  618. console.log(',,,')
  619. this.$Request.getA('/sys/user/info').then((res) => {
  620. console.log(res, 'kk')
  621. if (res.code == 0) {
  622. // this.userName = res.user.userEntity.userName
  623. this.userName = res.user.shopList[0].shopName
  624. // this.avatar = res.user.userEntity.avatar ? res.user.userEntity.avatar : '../../static/logo.png'
  625. this.avatar = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover : '../../static/logo.png'
  626. this.$queue.setData('userId', res.user.userId)
  627. this.$queue.setData('shopId', res.user.shopList[0].shopId)
  628. this.$queue.setData('mobile', res.user.mobile)
  629. if (res.user.userEntity) {
  630. this.$queue.setData('shopUserName', res.user.userEntity.userName)
  631. }
  632. }
  633. })
  634. },
  635. goLogin(e) {
  636. uni.navigateTo({
  637. url: e
  638. })
  639. }
  640. }
  641. }
  642. </script>
  643. <style lang="scss">
  644. page {
  645. background-color: #ffffff;
  646. }
  647. .bg {
  648. background-color: #ffffff;
  649. }
  650. .box {
  651. width: 690upx;
  652. margin: 0 auto;
  653. height: 120rpx;
  654. background: rgba(255, 141, 26, 0.6);
  655. border-radius: 16upx 16upx 0px 0px;
  656. color: #333333;
  657. padding: 0upx 30upx;
  658. margin-top: 20upx;
  659. }
  660. .orderbox {
  661. width: 690upx;
  662. margin: 0 auto;
  663. height: 153upx;
  664. background: #fafafa;
  665. border-radius: 16upx;
  666. display: flex;
  667. align-items: center;
  668. justify-content: space-between;
  669. text-align: center;
  670. padding: 0upx 30upx;
  671. }
  672. .privacy {
  673. position: fixed;
  674. top: 0;
  675. right: 0;
  676. bottom: 0;
  677. left: 0;
  678. background: rgba(0, 0, 0, 0.5);
  679. z-index: 9999999;
  680. display: flex;
  681. align-items: center;
  682. justify-content: center;
  683. }
  684. .contentview {
  685. width: 632rpx;
  686. padding: 48rpx;
  687. box-sizing: border-box;
  688. background: #fff;
  689. border-radius: 16rpx;
  690. }
  691. .contentview .title {
  692. text-align: center;
  693. color: #333;
  694. font-weight: bold;
  695. font-size: 32rpx;
  696. }
  697. .contentview .des {
  698. font-size: 26rpx;
  699. color: #666;
  700. margin-top: 40rpx;
  701. text-align: justify;
  702. line-height: 1.6;
  703. }
  704. .contentview .des .link {
  705. color: #07c160;
  706. text-decoration: underline;
  707. }
  708. button::after {
  709. border: none;
  710. }
  711. .btns {
  712. margin-top: 48rpx;
  713. display: flex;
  714. }
  715. .btns .item {
  716. justify-content: space-between;
  717. width: 244rpx;
  718. height: 80rpx;
  719. display: flex;
  720. align-items: center;
  721. justify-content: center;
  722. border-radius: 16rpx;
  723. box-sizing: border-box;
  724. border: none;
  725. }
  726. .btns .reject {
  727. background: #f4f4f5;
  728. color: #909399;
  729. }
  730. .btns .agree {
  731. background: #07c160;
  732. color: #fff;
  733. }
  734. .status {
  735. display: flex;
  736. justify-content: space-evenly;
  737. align-items: center;
  738. margin-left: auto;
  739. width: 215rpx;
  740. height: 93rpx;
  741. border: 2rpx solid #0061ff;
  742. border-radius: 10rpx;
  743. }
  744. </style>