index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  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('admin')))
  203. this.userId = uni.getStorageSync('userId')
  204. if (this.userId) {
  205. this.getFb()
  206. }
  207. this.$Request.getT('/app/common/type/354').then((res) => {
  208. //订单取消通知
  209. if (res.code == 0) {
  210. if (res.data && res.data.value) {
  211. this.arr.push(res.data.value)
  212. }
  213. }
  214. })
  215. this.$Request.getT('/app/common/type/353').then((res) => {
  216. //订单取消通知
  217. if (res.code == 0) {
  218. if (res.data && res.data.value) {
  219. this.arr.push(res.data.value)
  220. }
  221. }
  222. })
  223. this.$Request.getT('/app/common/type/352').then((res) => {
  224. //新订单通知
  225. if (res.code == 0) {
  226. if (res.data && res.data.value) {
  227. this.arr.push(res.data.value)
  228. }
  229. }
  230. })
  231. // #ifdef MP-WEIXIN
  232. try {
  233. let that = this
  234. wx.getPrivacySetting({
  235. success: (res) => {
  236. console.log('是否需要授权:', res.needAuthorization, '隐私协议的名称为:', res.privacyContractName)
  237. if (res.needAuthorization) {
  238. that.privacyContractName = res.privacyContractName
  239. // this.$refs.popusAuthorization.open();
  240. that.Authorization = true
  241. }
  242. },
  243. fail: () => {},
  244. complete: () => {}
  245. })
  246. } catch (e) {
  247. //TODO handle the exception
  248. }
  249. // #endif
  250. },
  251. onShow() {
  252. this.userId = uni.getStorageSync('userId')
  253. if (this.userId) {
  254. this.isLogin = false
  255. this.getUserInfo()
  256. this.getFb()
  257. // this.getTodayOrder()
  258. this.getcity()
  259. this.getShopInfo()
  260. // #ifdef MP-WEIXIN
  261. //订阅
  262. if (!uni.getStorageSync('sendindexMsg')) {
  263. this.openMsg()
  264. }
  265. // #endif
  266. } else {
  267. this.isLogin = true
  268. // this.userName = '匿名'
  269. this.avatar = '../../static/logo.png'
  270. this.allMoney = 0 //总收益
  271. this.putawayCount = 0 //上架中
  272. this.soldoutCount = 0 //下架中
  273. this.allCount = 0 //总销量
  274. this.countTakingByUserId = 0 //用户评价
  275. this.orderMoney = 0 //订单收入
  276. this.sumCountOrder = 0 //总订单数
  277. this.refundMoney = 0 //退款金额
  278. this.countByUserId = 0 //访客人数
  279. this.i1 = 0 //待付款
  280. this.i3 = 0 //待取餐
  281. this.i2 = 0 //制作中
  282. this.i4 = 0 //已完成
  283. this.i5 = 0 //商家待接单
  284. }
  285. let that = this
  286. if (that.userId) {
  287. setInterval(function () {
  288. // 订单消息提醒
  289. // newsSelect() {
  290. let data = {
  291. shopIds: that.$queue.getData('shopId')
  292. }
  293. that.$Request.post('/admin/ordermessage/selectReadFlagCount', data).then((res) => {
  294. if (res.code === 0) {
  295. // that.errCount = res.data
  296. if (res.data > 0) {
  297. if (that.errCount != res.data) {
  298. that.errCount = res.data
  299. that.aplayAudio()
  300. uni.showModal({
  301. title: '消息',
  302. content: '有' + res.data + '条订单,请前往订单中心处理。',
  303. success: (ret) => {
  304. if (ret.confirm) {
  305. uni.switchTab({
  306. url: '/pages/order/index'
  307. })
  308. } else {
  309. console.log('else', ret)
  310. that.defineCallBack()
  311. }
  312. }
  313. })
  314. // this.chatNum = data.data
  315. }
  316. } else {
  317. that.errCount = 0
  318. }
  319. }
  320. })
  321. }, 10000)
  322. }
  323. },
  324. methods: {
  325. // 打开隐私协议页面
  326. openPrivacyContract() {
  327. let that = this
  328. wx.openPrivacyContract({
  329. fail: () => {
  330. that.$queue.showToast('遇到错误无法打开!')
  331. }
  332. })
  333. },
  334. // 拒绝隐私协议
  335. exitMiniProgram() {
  336. // 直接退出小程序
  337. wx.exitMiniProgram()
  338. },
  339. // 同意隐私协议
  340. handleAgreePrivacyAuthorization() {
  341. this.Authorization = false
  342. },
  343. openMsg() {
  344. var that = this
  345. wx.getSetting({
  346. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  347. success(ret) {
  348. if (ret.subscriptionsSetting.itemSettings) {
  349. uni.setStorageSync('sendindexMsg', true)
  350. uni.openSetting({
  351. // 打开设置页
  352. success(rea) {
  353. console.log(rea.authSetting)
  354. }
  355. })
  356. } else {
  357. // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  358. uni.setStorageSync('sendindexMsg', false)
  359. uni.showModal({
  360. title: '提示',
  361. content: '为了更好的体验,请绑定消息推送',
  362. confirmText: '确定',
  363. cancelText: '取消',
  364. success: function (res) {
  365. if (res.confirm) {
  366. uni.requestSubscribeMessage({
  367. tmplIds: that.arr,
  368. success(re) {
  369. // console.log(re,'**********')
  370. var datas = JSON.stringify(re)
  371. if (datas.indexOf('accept') != -1) {
  372. console.log(re)
  373. }
  374. },
  375. fail: (res) => {
  376. console.log(res)
  377. }
  378. })
  379. that.showModal = false
  380. } else if (res.cancel) {
  381. that.showModal = true
  382. }
  383. }
  384. })
  385. }
  386. }
  387. })
  388. },
  389. //切换店铺状态
  390. changePutaWayFlag() {
  391. if (this.shop.putawayFlag == 0) {
  392. uni.showModal({
  393. title: '提示',
  394. content: '确定要打烊了吗?',
  395. showCancel: true,
  396. cancelText: '取消',
  397. confirmText: '确定',
  398. success: (res) => {
  399. if (res.confirm) {
  400. this.shop.putawayFlag = 1
  401. this.updateShopInfo()
  402. }
  403. },
  404. fail: () => {},
  405. complete: () => {}
  406. })
  407. } else {
  408. this.shop.putawayFlag = 0
  409. this.updateShopInfo()
  410. }
  411. },
  412. updateShopInfo() {
  413. this.$Request.postJsonA('/app/shop/updateShopMessage', this.shop).then((res) => {
  414. if (res.code == 0) {
  415. this.getShopInfo()
  416. } else {
  417. // this.shop.putawayFlag = 1
  418. uni.showModal({
  419. title: '提示',
  420. content: res.msg,
  421. success: function (res) {
  422. if (res.confirm) {
  423. } else if (res.cancel) {
  424. }
  425. }
  426. })
  427. this.getShopInfo()
  428. }
  429. })
  430. },
  431. getShopInfo() {
  432. if (this.$queue.getData('shopId')) {
  433. let data = {
  434. shopId: this.$queue.getData('shopId')
  435. }
  436. this.$Request.getA('/app/shop/selectShopMessage', data).then((res) => {
  437. if (res.code == 0) {
  438. uni.hideLoading()
  439. this.shop = res.data
  440. }
  441. })
  442. }
  443. },
  444. aplayAudio() {
  445. // const audio = document.getElementById('audio')
  446. // audio.play()
  447. // console.log('语音提示')
  448. const innerAudioContext = uni.createInnerAudioContext()
  449. innerAudioContext.autoplay = true
  450. // innerAudioContext.src ='../../static/mpc/order.mp3';
  451. innerAudioContext.src = 'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3'
  452. innerAudioContext.onPlay(() => {
  453. console.log('开始播放')
  454. })
  455. innerAudioContext.onError((res) => {
  456. console.log(res.errMsg)
  457. console.log(res.errCode)
  458. })
  459. },
  460. defineCallBack() {
  461. let that = this
  462. let data = {
  463. shopIds: that.$queue.getData('shopId')
  464. }
  465. that.$Request.post('/admin/ordermessage/allcheckOrderMessage', data).then((res) => {
  466. if (res.code === 0) {
  467. that.errCount = 0
  468. }
  469. })
  470. },
  471. getcity() {
  472. let that = this
  473. uni.getLocation({
  474. type: 'wgs84',
  475. success: function (res) {
  476. // console.log('当前位置的经度:' + res.longitude);
  477. // console.log('当前位置的纬度:' + res.latitude);
  478. that.latitude = res.latitude
  479. that.longitude = res.longitude
  480. }
  481. })
  482. },
  483. //获取用户发布
  484. getFb() {
  485. let data = {
  486. startTime: this.startTime,
  487. endTime: this.endTime,
  488. shopId: this.$queue.getData('shopId')
  489. }
  490. this.$Request.getA('/app/shop/shopHomePage', data).then((res) => {
  491. if (res.code == 0) {
  492. this.allMoney = res.data.allMoney //总收益
  493. this.putawayCount = res.data.putawayCount //上架中
  494. this.soldoutCount = res.data.soldoutCount //下架中
  495. this.allCount = res.data.allCount //总销量
  496. this.countTakingByUserId = res.data.countTakingByUserId //用户评价
  497. this.orderMoney = res.data.orderMoney //订单收入
  498. this.sumCountOrder = res.data.sumCountOrder //总订单数
  499. this.refundMoney = res.data.refundMoney //退款金额
  500. this.countByUserId = res.data.countByUserId //访客人数
  501. this.i1 = res.data.i1 //待付款
  502. this.i3 = res.data.i3 //待取餐
  503. this.i2 = res.data.i2 //制作中
  504. this.i4 = res.data.i4 //已完成
  505. this.i5 = res.data.i5 //商家待接单
  506. }
  507. })
  508. },
  509. goDetail(index) {
  510. // #ifdef MP-WEIXIN
  511. if (uni.getStorageSync('sendindexMsg')) {
  512. uni.requestSubscribeMessage({
  513. tmplIds: this.arr,
  514. success(re) {
  515. // console.log(re,'**********')
  516. var datas = JSON.stringify(re)
  517. if (datas.indexOf('accept') != -1) {
  518. console.log(re)
  519. }
  520. },
  521. fail: (res) => {
  522. console.log(res)
  523. }
  524. })
  525. }
  526. // #endif
  527. if (index == 1) {
  528. uni.switchTab({
  529. url: '/pages/order/index'
  530. })
  531. } else if (index == 2) {
  532. uni.navigateTo({
  533. url: '/my/store/addgood'
  534. })
  535. }
  536. },
  537. bindFb() {
  538. let userId = uni.getStorageSync('userId')
  539. if (userId) {
  540. uni.navigateTo({
  541. url: '/my/publish/goods'
  542. })
  543. } else {
  544. uni.showModal({
  545. title: '提示',
  546. content: '您还未登录,请先登录',
  547. success: function (res) {
  548. if (res.confirm) {
  549. // console.log('用户点击确定');
  550. uni.navigateTo({
  551. url: '/pages/my/loginphone'
  552. })
  553. } else if (res.cancel) {
  554. // console.log('用户点击取消');
  555. }
  556. }
  557. })
  558. }
  559. },
  560. //时间弹框开关
  561. bindData(index) {
  562. if (index == 1) {
  563. this.startshow = true
  564. } else if (index == 2) {
  565. this.endshow = true
  566. }
  567. },
  568. //开始时间
  569. startData(e) {
  570. this.startTime = e.year + '-' + e.month + '-' + e.day
  571. },
  572. // 结束时间
  573. endData(e) {
  574. this.endTime = e.year + '-' + e.month + '-' + e.day
  575. this.getFb()
  576. },
  577. goNav(e, name) {
  578. if (this.userId) {
  579. // #ifdef MP-WEIXIN
  580. if (uni.getStorageSync('sendindexMsg')) {
  581. uni.requestSubscribeMessage({
  582. tmplIds: this.arr,
  583. success(re) {
  584. // console.log(re,'**********')
  585. var datas = JSON.stringify(re)
  586. if (datas.indexOf('accept') != -1) {
  587. console.log(re)
  588. }
  589. },
  590. fail: (res) => {
  591. console.log(res)
  592. }
  593. })
  594. }
  595. // #endif
  596. uni.navigateTo({
  597. url: e
  598. })
  599. } else {
  600. uni.showModal({
  601. title: '提示',
  602. content: '您还未登录,请先登录',
  603. success: function (res) {
  604. if (res.confirm) {
  605. console.log('用户点击确定')
  606. uni.navigateTo({
  607. url: '/pages/my/loginphone'
  608. })
  609. } else if (res.cancel) {
  610. console.log('用户点击取消')
  611. }
  612. }
  613. })
  614. }
  615. },
  616. getUserInfo() {
  617. console.log(',,,')
  618. this.$Request.getA('/sys/user/info').then((res) => {
  619. console.log(res, 'kk')
  620. if (res.code == 0) {
  621. // this.userName = res.user.userEntity.userName
  622. this.userName = res.user.shopList[0].shopName
  623. // this.avatar = res.user.userEntity.avatar ? res.user.userEntity.avatar : '../../static/logo.png'
  624. this.avatar = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover : '../../static/logo.png'
  625. this.$queue.setData('userId', res.user.userId)
  626. this.$queue.setData('shopId', res.user.shopList[0].shopId)
  627. this.$queue.setData('mobile', res.user.mobile)
  628. if (res.user.userEntity) {
  629. this.$queue.setData('shopUserName', res.user.userEntity.userName)
  630. }
  631. }
  632. })
  633. },
  634. goLogin(e) {
  635. uni.navigateTo({
  636. url: e
  637. })
  638. }
  639. }
  640. }
  641. </script>
  642. <style lang="scss">
  643. page {
  644. background-color: #ffffff;
  645. }
  646. .bg {
  647. background-color: #ffffff;
  648. }
  649. .box {
  650. width: 690upx;
  651. margin: 0 auto;
  652. height: 120rpx;
  653. background: rgba(255, 141, 26, 0.6);
  654. border-radius: 16upx 16upx 0px 0px;
  655. color: #333333;
  656. padding: 0upx 30upx;
  657. margin-top: 20upx;
  658. }
  659. .orderbox {
  660. width: 690upx;
  661. margin: 0 auto;
  662. height: 153upx;
  663. background: #fafafa;
  664. border-radius: 16upx;
  665. display: flex;
  666. align-items: center;
  667. justify-content: space-between;
  668. text-align: center;
  669. padding: 0upx 30upx;
  670. }
  671. .privacy {
  672. position: fixed;
  673. top: 0;
  674. right: 0;
  675. bottom: 0;
  676. left: 0;
  677. background: rgba(0, 0, 0, 0.5);
  678. z-index: 9999999;
  679. display: flex;
  680. align-items: center;
  681. justify-content: center;
  682. }
  683. .contentview {
  684. width: 632rpx;
  685. padding: 48rpx;
  686. box-sizing: border-box;
  687. background: #fff;
  688. border-radius: 16rpx;
  689. }
  690. .contentview .title {
  691. text-align: center;
  692. color: #333;
  693. font-weight: bold;
  694. font-size: 32rpx;
  695. }
  696. .contentview .des {
  697. font-size: 26rpx;
  698. color: #666;
  699. margin-top: 40rpx;
  700. text-align: justify;
  701. line-height: 1.6;
  702. }
  703. .contentview .des .link {
  704. color: #07c160;
  705. text-decoration: underline;
  706. }
  707. button::after {
  708. border: none;
  709. }
  710. .btns {
  711. margin-top: 48rpx;
  712. display: flex;
  713. }
  714. .btns .item {
  715. justify-content: space-between;
  716. width: 244rpx;
  717. height: 80rpx;
  718. display: flex;
  719. align-items: center;
  720. justify-content: center;
  721. border-radius: 16rpx;
  722. box-sizing: border-box;
  723. border: none;
  724. }
  725. .btns .reject {
  726. background: #f4f4f5;
  727. color: #909399;
  728. }
  729. .btns .agree {
  730. background: #07c160;
  731. color: #fff;
  732. }
  733. .status {
  734. display: flex;
  735. justify-content: space-evenly;
  736. align-items: center;
  737. margin-left: auto;
  738. width: 215rpx;
  739. height: 93rpx;
  740. border: 2rpx solid #0061ff;
  741. border-radius: 10rpx;
  742. }
  743. </style>