index.vue 24 KB

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