index.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357
  1. <template>
  2. <view class="home" :class="showGuide?'show_guide':''">
  3. <view>
  4. <view class="guide_box" v-if="showGuide" @click="showGuide = false"></view>
  5. <view class="guide_box flexCC mask" v-if="showAuth"></view>
  6. <view class="home_bg">
  7. <image src="/static/imgs/shop/index_bg.png"></image>
  8. </view>
  9. <view class="home_box">
  10. <view class="home_con">
  11. <view class="shop">
  12. <view class="shop_top">
  13. <!-- <view class="flexS" @click="isLogin?sikpEval:''"> -->
  14. <view class="flexS" @click="isNewLogin?sikpEval:''">
  15. <!-- <image :src="shopInfo.img" class="store_img"></image> -->
  16. <image :src="headimgurl?headimgurl:defaultAvatarUrl" class="store_img"></image>
  17. <view v-if="isNewLogin">
  18. <view style="font-size:36rpx;font-weight: bold;" v-if="nickname">
  19. {{ nickname | getName(18) }}的店铺
  20. </view>
  21. <view class="flexS shop_eval">
  22. <text>店铺评价</text>
  23. <view v-for="(i, idx) in shopInfo.star" :key="idx"><text
  24. class="iconfont iconxingxing" style="color:#FB231F;"></text></view>
  25. <view v-for="(i, index) in star" :key="index"><text
  26. class="iconfont iconxingxing" style="color:#999;"></text></view>
  27. </view>
  28. </view>
  29. <view v-else>
  30. <button @click="denglu" class="login_btn">点击登录</button>
  31. </view>
  32. </view>
  33. <view @click="skipEdit" class="edit" v-if="isNewLogin">编辑</view>
  34. </view>
  35. <view class="shop_bottom flexB">
  36. <view @click="skipPage(0)">
  37. <view>{{ dataInfo.order_num || 0 }}</view>
  38. <view>今日销量</view>
  39. </view>
  40. <view @click="skipPage(1)">
  41. <view>{{ dataInfo.order_money || 0 }}</view>
  42. <view>今日金额</view>
  43. </view>
  44. <view @click="skipPage(2)">
  45. <view>{{ dataInfo.see_num || 0 }}</view>
  46. <view>今日浏览</view>
  47. </view>
  48. </view>
  49. <!-- <view class="shop_bottom flexB">
  50. <view @click="skipPage(0)">
  51. <view>{{ dataInfo.order_num || 0 }}</view>
  52. <view>今日销量</view>
  53. </view>
  54. <view @click="skipPage(1)">
  55. <view>{{ dataInfo.order_money || 0 }}</view>
  56. <view>今日金额</view>
  57. </view>
  58. <view @click="skipPage(2)">
  59. <view>{{ dataInfo.see_num || 0 }}</view>
  60. <view>今日浏览</view>
  61. </view>
  62. </view> -->
  63. <view v-if="showPlace" class="sub_btn" @click="skipShare">商品管理及分享</view>
  64. </view>
  65. <view class="handle">
  66. <view class="block_con flexCC" :class="item.id === 6 ? 'block_con_red' : ''"
  67. v-for="item in indexList" :key="item.id">
  68. <view class="block_box flexB" @click="skipDel(item.url)">
  69. <view>
  70. <text class="block_title">{{ item.title }}</text>
  71. <view class="block_intr">{{ item.intr }}</view>
  72. </view>
  73. <image :src="item.icon"
  74. :style="{ width: item.width + 'rpx', height: item.height + 'rpx' }"></image>
  75. <view class="block_num" v-if="item.id == 4 && dataInfo.wait_send_num > 0">
  76. {{ dataInfo.wait_send_num }}
  77. </view>
  78. <view class="block_num" v-if="item.id == 5 && dataInfo.no_auth > 0">
  79. {{ dataInfo.no_auth }}
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="box flexB">
  85. <view class="box_item" @click="skipPage(4)">
  86. <image src="../../static/imgs/shop/bottom1.png" mode=""></image>
  87. <view>联系客服</view>
  88. </view>
  89. <view class="box_item" @click="skip">
  90. <image src="../../static/imgs/shop/bottom2.png" mode=""></image>
  91. <view>争霸赛小程序</view>
  92. </view>
  93. <view class="box_item" @click="skipVideo" :class="showGuide?'show_box':''">
  94. <image src="../../static/imgs/shop/bottom3.png" mode=""></image>
  95. <view>微店教程</view>
  96. </view>
  97. <text class="iconfont iconguanbi" @click="showGuide = false" v-if="showGuide"></text>
  98. <image src="../../static/imgs/shop/shop_guid.png" class="express_img" v-if="showGuide"></image>
  99. </view>
  100. <view class="hint_img">
  101. <image src="../../static/imgs/shop/shop_hint.png" class="shop_hint"></image>
  102. </view>
  103. </view>
  104. </view>
  105. <view class="share_show" v-if="shareShow">
  106. <view class="share_con flexCC">
  107. <text class="iconfont iconguanbi1" @click="shareShow = false"></text>
  108. <view class="canvas">
  109. <canvas canvas-id="canvas" style="width: 100%;height:100%;" id="canvas"><img :src="poster"
  110. class="poster_img" mode="widthFix" @click="preview" /></canvas>
  111. </view>
  112. <view class="save_img">点击图片-长按-发送给朋友</view>
  113. <view class="sub_btn" @click="skip">点击进入争霸赛小程序</view>
  114. </view>
  115. </view>
  116. <!-- <u-popup v-model="showApply" mode="bottom" height="700rpx;">
  117. <view class="pop_box">
  118. <view>初六店铺申请</view>
  119. <view>获取你的头像、昵称</view>
  120. <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
  121. <image class="avatar" :src="headimgurl" v-if="headimgurl"></image>
  122. </button>
  123. <view class="name flexS">
  124. <text>昵称</text>
  125. <input type="nickname" class="weui-input" placeholder="请输入昵称" v-model="nickname" @change="getInputVal" />
  126. </view>
  127. <view class="btn_box flexCC">
  128. <view @click="submit" class="btn flexCC">允许</view>
  129. <view @click="submit" class="btn flexCC">拒绝</view>
  130. </view>
  131. </view>
  132. </u-popup> -->
  133. </view>
  134. </view>
  135. </template>
  136. <script>
  137. import {
  138. getStoreInfo,
  139. shareStore,
  140. getZbsRank
  141. } from '@/apis/shop.js';
  142. import {
  143. wxLogin,
  144. } from '../../apis/login.js';
  145. import getName from '../../filters/index.js';
  146. export default {
  147. data() {
  148. return {
  149. // showApply:true,
  150. defaultAvatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
  151. isLogin: false, //是否登录
  152. showPlace: true,
  153. searchName: '', //订单查询内容
  154. shareShow: false, //显示海报
  155. canvasWidth: 0, //canvas 宽
  156. canvasHeight: 0, //canvas 高
  157. shopInfo: '', //店铺信息
  158. store: '', //店铺信息
  159. qrImg: '', //二维码图片
  160. poster: '', //海报图片
  161. star: '', //灰色星星个数
  162. state: '', //获取认证状态
  163. signCode: '', //待签约的二维码
  164. dataInfo: '', //数据信息
  165. model: '', //手机型号
  166. indexList: [{
  167. id: 1,
  168. title: '客户',
  169. intr: '客户信息精确管理',
  170. icon: '/static/imgs/shop/icon1.png',
  171. url: '../../pagesA/pages/user-manage/user-manage',
  172. width: 61,
  173. height: 66
  174. },
  175. {
  176. id: 2,
  177. title: '钱包',
  178. intr: '收入明细及提现',
  179. icon: '/static/imgs/shop/icon2.png',
  180. url: '../../pagesA/pages/capital-manage/capital-manage',
  181. width: 73,
  182. height: 74
  183. },
  184. // {
  185. // id: 3,
  186. // title: '奖学金',
  187. // intr: '奖学金可兑换礼品',
  188. // icon: '/static/imgs/shop/icon3.png',
  189. // url: '../../pagesA/pages/integral-rank/integral-rank',
  190. // width: 60,
  191. // height: 60
  192. // },
  193. {
  194. id: 4,
  195. title: '订单',
  196. intr: '订单详情及发货',
  197. icon: '/static/imgs/shop/icon4.png',
  198. url: '../order-manage/order-manage',
  199. width: 66,
  200. height: 53
  201. },
  202. {
  203. id: 6,
  204. title: '代下单',
  205. intr: '快速帮客户下单',
  206. icon: '/static/imgs/shop/icon6.png',
  207. url: '../user-list/user-list',
  208. width: 50,
  209. height: 62
  210. },
  211. {
  212. id: 5,
  213. title: '退货',
  214. intr: '订单退货及取消',
  215. icon: '/static/imgs/shop/icon5.png',
  216. url: '../../pagesA/pages/refund-manage/refund-manage',
  217. width: 57,
  218. height: 57
  219. },
  220. ],
  221. isForbidden: false, //店铺是否被禁用
  222. hintCon: '', //不能使用店铺提示内容
  223. timer: null, //定时器
  224. showGuide: false,
  225. showAuth: false, //显示认证店铺按钮
  226. isShow: true,
  227. headimgurl: '', //用户头像
  228. nickname: '', //用户昵称
  229. isNewLogin: false //判断用户是否登录(获取头像昵称)
  230. };
  231. },
  232. onLoad() {
  233. const _this = this;
  234. uni.getSystemInfo({
  235. success: res => {
  236. _this.model = res.model;
  237. _this.canvasWidth = res.windowWidth / 375;
  238. _this.canvasHeight = res.windowHeight;
  239. }
  240. });
  241. },
  242. onShow() {
  243. this.headimgurl = uni.getStorageSync('headimgurl')
  244. this.nickname = uni.getStorageSync('nickname')
  245. if (this.headimgurl && this.nickname) {
  246. this.isNewLogin = true
  247. this.getShop();
  248. } else {
  249. this.isNewLogin = false
  250. }
  251. // if (!this.headimgurl || !this.nickname) {
  252. // uni.showModal({
  253. // content: '请先登录',
  254. // showCancel: false
  255. // })
  256. // } else {
  257. // this.getShop();
  258. // }
  259. // this.userLogin()
  260. // if (!uni.getStorageSync('token')) {
  261. // this.login()
  262. // } else {
  263. // this.getShop();
  264. // }
  265. // this.searchName = '';
  266. },
  267. onPullDownRefresh() {
  268. uni.startPullDownRefresh();
  269. this.getShop();
  270. },
  271. methods: {
  272. denglu() {
  273. uni.navigateTo({
  274. url: '/pagesA/pages/login-new/login-new'
  275. })
  276. },
  277. moveHandle() {
  278. return;
  279. },
  280. //获取争霸赛奖学金及排名
  281. getData() {
  282. getZbsRank().then(res => {
  283. if (res.code == 200) {
  284. this.scoreData = res.data;
  285. const {
  286. type
  287. } = res.data;
  288. if (type == 1) {
  289. uni.getImageInfo({
  290. src: this.shopInfo.img,
  291. success: res => {
  292. this.shareShow = true
  293. this.drawImg(res.path)
  294. }
  295. })
  296. }
  297. }
  298. })
  299. },
  300. //进入争霸赛小程序
  301. skip() {
  302. uni.navigateToMiniProgram({
  303. appId: 'wx0348d5a266f867a3',
  304. path: 'pages/index/index',
  305. extraData: {
  306. 'data1': 'test'
  307. },
  308. success(res) {
  309. // 打开成功
  310. }
  311. })
  312. },
  313. preview() {
  314. uni.previewImage({
  315. current: this.poster,
  316. urls: [this.poster]
  317. });
  318. },
  319. //跳转页面
  320. skipPage(type) {
  321. if (!this.isNewLogin) {
  322. uni.showModal({
  323. content: '请先登录',
  324. success: res => {
  325. if (res.confirm) {
  326. uni.navigateTo({
  327. url: '/pagesA/pages/login-new/login-new'
  328. })
  329. }
  330. }
  331. })
  332. return
  333. }
  334. if (this.isForbidden) {
  335. //证明店铺被禁用
  336. uni.showModal({
  337. content: this.hintCon,
  338. showCancel: false
  339. });
  340. return false;
  341. }
  342. let url = '';
  343. switch (type) {
  344. case 0:
  345. url = '../order-manage/order-manage?status=' + 0
  346. break;
  347. case 1:
  348. url = '../../pagesA/pages/capital-manage/capital-manage'
  349. break;
  350. case 2:
  351. url = '../../pagesA/pages/brow-user/brow-user'
  352. break;
  353. case 3:
  354. url = '../auth-step/auth-step'
  355. break;
  356. case 4: //联系政委
  357. url = '../../pagesA/pages/qr-code/qr-code'
  358. default:
  359. break;
  360. }
  361. uni.navigateTo({
  362. url
  363. })
  364. },
  365. //登录
  366. login() {
  367. let _this = this
  368. uni.showLoading({
  369. title: '自动登录中...'
  370. })
  371. uni.login({
  372. success: re => {
  373. if (re.errMsg == 'login:ok') {
  374. wxLogin({
  375. wxcode: re.code
  376. }).then(res => {
  377. if (Number(res.code) == 450005) { //被系统删除
  378. uni.redirectTo({
  379. url: '../../pagesA/pages/login-fail/login-fail?hint=' +
  380. '你已被系统删除'
  381. })
  382. return false
  383. }
  384. if (Number(res.code == 450013)) {
  385. uni.showModal({
  386. content: '登陆失败,请手动登录',
  387. showCancel: false,
  388. success: res => {
  389. if (res.confirm) {
  390. uni.redirectTo({
  391. url: '../login/login'
  392. })
  393. }
  394. }
  395. })
  396. return false;
  397. }
  398. if (res.code == 200) {
  399. const {
  400. token,
  401. user,
  402. is_agent
  403. } = res.data;
  404. uni.setStorageSync('token', token)
  405. _this.getShop();
  406. } else {
  407. let hint = res.data
  408. uni.showModal({
  409. content: res.data || '登录失败',
  410. showCancel: false,
  411. success: res => {
  412. if (res.confirm) {
  413. uni.redirectTo({
  414. url: '../../pagesA/pages/login-fail/login-fail?hint=' +
  415. hint
  416. })
  417. }
  418. }
  419. })
  420. }
  421. uni.hideLoading()
  422. }).catch(err => {
  423. uni.hideLoading()
  424. })
  425. }
  426. },
  427. fail: err => {
  428. uni.hideLoading()
  429. uni.showModal({
  430. content: '登录失败',
  431. showCancel: false
  432. })
  433. }
  434. })
  435. },
  436. //跳转到商品分享页面
  437. skipShare() {
  438. if (!this.isNewLogin) {
  439. uni.showModal({
  440. content: '请先登录',
  441. success: res => {
  442. if (res.confirm) {
  443. uni.navigateTo({
  444. url: '/pagesA/pages/login-new/login-new'
  445. })
  446. }
  447. }
  448. })
  449. } else {
  450. uni.navigateTo({
  451. url: '../goods-share/goods-share'
  452. });
  453. }
  454. },
  455. //跳转到如何操作视频页面
  456. skipVideo() {
  457. uni.navigateTo({
  458. url: '../shop-video/shop-video'
  459. });
  460. },
  461. //跳转到协议
  462. skipProtocol() {
  463. uni.navigateTo({
  464. url: '../../pagesA/pages/protocol/protocol'
  465. });
  466. },
  467. //获取code值方法
  468. getUrlParam(name) {
  469. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); //构造一个含有目标参数的正则表达式对象
  470. var r = window.location.search.substr(1).match(reg); //匹配目标参数
  471. if (r != null) return decodeURIComponent(r[2]);
  472. return null; //返回参数值
  473. },
  474. /*获取店铺信息*/
  475. getShop() {
  476. uni.showLoading({
  477. title: '加载中...',
  478. mask: true
  479. });
  480. //进入店铺根据is_apply判断认证的状态,提交认证之后,返回首页显示审核中,审核通过之后显示签约二维码,
  481. getStoreInfo()
  482. .then(res => {
  483. uni.stopPullDownRefresh();
  484. if (Number(res.code) == 450005) { //被系统删除
  485. uni.redirectTo({
  486. url: '../../pagesA/pages/login-fail/login-fail?hint=' +
  487. '你已被系统删除'
  488. })
  489. return false
  490. }
  491. if (Number(res.code) == 450004) {
  492. uni.redirectTo({
  493. url: '../../pagesA/pages/login-fail/login-fail?hint=' +
  494. '店铺已禁用,请联系上级管理员'
  495. })
  496. //店铺已禁用
  497. // this.hintCon = '店铺已禁用,请联系上级管理员';
  498. // uni.showModal({
  499. // content: this.hintCon,
  500. // showCancel: false
  501. // });
  502. // return false;
  503. }
  504. if (res.code == 200) {
  505. this.dataInfo = res.data;
  506. this.shopInfo = res.data.store;
  507. uni.setStorageSync('store', res.data.store);
  508. const {
  509. is_apply,
  510. show_num1,
  511. qr_code,
  512. level
  513. } = this.shopInfo;
  514. // this.isForbidden = is_delete === 1 ? false : true
  515. // 2023-02-03 09:00:00 起 销售主管隐藏 ‘商品管理及分享’和‘代下单’
  516. const time = Date.parse(new Date())
  517. const endTime = 1675386000000
  518. if (level == 1 && (time >= endTime)) {
  519. this.showPlace = false
  520. let i = this.indexList.findIndex(item => item.id == 6)
  521. if (i != -1) {
  522. this.indexList.splice(i, 1)
  523. }
  524. }
  525. uni.setStorageSync('qrCode', qr_code)
  526. if (is_apply != 3) {
  527. uni.redirectTo({
  528. url: '../../pagesA/pages/login-fail/login-fail?hint=' + '暂时停止微店认证'
  529. })
  530. // uni.redirectTo({
  531. // url: '../auth-step/auth-step'
  532. // })
  533. return false;
  534. }
  535. if (Number(res.data.is_delete) === 1) {
  536. uni.reLaunch({
  537. url: '../../pagesA/pages/del-withdrawal/del-withdrawal'
  538. })
  539. return false
  540. }
  541. this.showAuth = false;
  542. this.showGuide = show_num1 == 1 ? true : false
  543. //显示星级
  544. this.star = 5 - Number(res.data.store.star);
  545. // this.getData()
  546. } else {
  547. uni.showModal({
  548. content: res.data,
  549. showCancel: false,
  550. success: res => {
  551. if (res.confirm) {
  552. uni.redirectTo({
  553. url: '../../pagesA/pages/login-fail/login-fail'
  554. })
  555. }
  556. }
  557. });
  558. }
  559. uni.hideLoading();
  560. })
  561. .catch(err => {
  562. uni.hideLoading();
  563. });
  564. },
  565. dataURLtoFile(dataurl, filename = 'file') {
  566. let arr = dataurl.split(',');
  567. let mime = arr[0].match(/:(.*?);/)[1];
  568. let suffix = mime.split('/')[1];
  569. let bstr = atob(arr[1]);
  570. let n = bstr.length;
  571. let u8arr = new Uint8Array(n);
  572. while (n--) {
  573. u8arr[n] = bstr.charCodeAt(n);
  574. }
  575. return new File([u8arr], `${filename}.${suffix}`, {
  576. type: mime
  577. });
  578. },
  579. //绘制元宝图片
  580. drawImg(avatar) {
  581. let _this = this;
  582. uni.getImageInfo({
  583. src: 'https://api.jiuweiyun.cn/public/uploads/icon/poster_new.png',
  584. success: res => {
  585. uni.showLoading({
  586. title: '图片加载中...'
  587. });
  588. const {
  589. score,
  590. ranking
  591. } = _this.scoreData;
  592. let ctx = uni.createCanvasContext('canvas');
  593. let rpx = _this.canvasWidth;
  594. ctx.drawImage(res.path, 0, 0, 270 * rpx, 450 * rpx);
  595. // 奖学金
  596. ctx.font = 'italic bold 28px pingfang';
  597. ctx.setFillStyle('#fff');
  598. ctx.textAlign = 'center';
  599. ctx.fillText(score, uni.upx2px(250), uni.upx2px(432));
  600. //排名
  601. ctx.font = 'italic bold 18px pingfang';
  602. ctx.setFillStyle('#fff');
  603. ctx.textAlign = 'center';
  604. ctx.fillText(ranking, uni.upx2px(270), uni.upx2px(467));
  605. //昵称
  606. ctx.beginPath(); //开始一个新的路径
  607. ctx.setLineWidth(2); //设置线条的宽度
  608. ctx.setStrokeStyle('#EF0A16'); //设置线条的样式
  609. ctx.setFillStyle('#EF0A16'); //设置填充的样式s
  610. ctx.font = 'noraml bold 18px pingfang';
  611. ctx.textAlign = 'center';
  612. ctx.fillText(this.shopInfo.name, uni.upx2px(270), uni.upx2px(360));
  613. ctx.moveTo(uni.upx2px(175), uni.upx2px(375)); //设置线条的起始路径坐标
  614. ctx.lineTo(uni.upx2px(365), uni.upx2px(375)); //设置线条的终点路径坐标
  615. ctx.stroke(); //对当前路径进行描边
  616. ctx.closePath(); //关闭当前路径
  617. ctx.beginPath();
  618. ctx.arc((55 * rpx) / 2 + 110 * rpx, (55 * rpx) / 2 + 104 * rpx, (55 * rpx) / 2,
  619. 0, Math
  620. .PI * 2,
  621. false); // 画一个圆形裁剪区域
  622. ctx.clip(); // 裁剪
  623. ctx.drawImage(avatar, 110 * rpx, 104 * rpx, 55 * rpx, 55 * rpx);
  624. ctx.restore(); //恢复之前保存的绘图上下文
  625. setTimeout(res => {
  626. ctx.draw(false, () => {
  627. uni.canvasToTempFilePath({
  628. width: 270 * rpx,
  629. height: 450 * rpx,
  630. canvasId: 'canvas',
  631. success: res => {
  632. uni.hideLoading();
  633. if (this.model == 'iPhone') {
  634. this.poster = this
  635. .dataURLtoFile(res
  636. .tempFilePath).name;
  637. } else {
  638. let url = res.tempFilePath
  639. .replace(
  640. /\. +/g, '');
  641. this.poster = url.replace(
  642. /[\r\n]/g,
  643. '');
  644. }
  645. }
  646. });
  647. });
  648. uni.hideLoading();
  649. }, 1000);
  650. }
  651. })
  652. },
  653. checkDel() {
  654. },
  655. /*点击跳转页面*/
  656. skipDel(url) {
  657. if (!this.isNewLogin) {
  658. uni.showModal({
  659. content: '请先登录',
  660. success: res => {
  661. if (res.confirm) {
  662. uni.navigateTo({
  663. url: '/pagesA/pages/login-new/login-new'
  664. })
  665. }
  666. }
  667. })
  668. return
  669. }
  670. if (this.isForbidden) {
  671. uni.showModal({
  672. content: '',
  673. showCancel: false
  674. });
  675. return false;
  676. }
  677. uni.navigateTo({
  678. url
  679. });
  680. },
  681. /*编辑店铺信息*/
  682. skipEdit() {
  683. if (this.isForbidden) {
  684. //证明店铺被禁用
  685. uni.showModal({
  686. content: this.hintCon,
  687. showCancel: false
  688. });
  689. return false;
  690. }
  691. uni.navigateTo({
  692. url: '../shop-info/shop-info'
  693. });
  694. },
  695. /*店铺评价*/
  696. sikpEval() {
  697. if (this.isForbidden) {
  698. //证明店铺被禁用
  699. uni.showModal({
  700. content: this.hintCon,
  701. showCancel: false
  702. });
  703. return false;
  704. }
  705. uni.navigateTo({
  706. url: '../evaluate/evaluate'
  707. });
  708. },
  709. /*查询订单*/
  710. searchOrder() {
  711. if (this.isForbidden) {
  712. //证明店铺被禁用
  713. uni.showModal({
  714. content: this.hintCon,
  715. showCancel: false
  716. });
  717. return false;
  718. }
  719. if (!this.searchName) {
  720. uni.showModal({
  721. content: '搜索内容不能为空',
  722. showCancel: false
  723. });
  724. return false;
  725. }
  726. uni.navigateTo({
  727. url: '../order-manage/order-manage?order_no=' + this.searchName
  728. });
  729. },
  730. }
  731. };
  732. </script>
  733. <style>
  734. page {
  735. width: 100%;
  736. min-height: 100%;
  737. background: #F9F9FB;
  738. }
  739. </style>
  740. <style lang="scss" scoped>
  741. .show_guide {
  742. overflow-y: hidden;
  743. position: fixed;
  744. height: 100vh;
  745. width: 100%;
  746. }
  747. .home {
  748. position: relative;
  749. min-height: 100%;
  750. width: 100%;
  751. .contact_icon {
  752. position: fixed;
  753. bottom: 164rpx;
  754. right: 44rpx;
  755. width: 167rpx;
  756. height: 173rpx;
  757. }
  758. .guide_box {
  759. width: 100vw;
  760. height: 100vh;
  761. position: fixed;
  762. top: 0;
  763. left: 0;
  764. background: rgba(0, 0, 0, 0.5);
  765. display: flex;
  766. flex-direction: column;
  767. align-items: center;
  768. z-index: 999;
  769. .express_img {
  770. width: 659rpx;
  771. height: 229rpx;
  772. margin-top: 70vh;
  773. margin-left: 50rpx;
  774. }
  775. }
  776. .mask {
  777. z-index: 99999;
  778. }
  779. .home_bg {
  780. width: 750rpx;
  781. height: 312rpx;
  782. image {
  783. width: 100%;
  784. height: 100%;
  785. }
  786. }
  787. .home_box {
  788. width: 100%;
  789. position: relative;
  790. margin-top: -295rpx;
  791. .home_con {
  792. width: 690rpx;
  793. margin: 0 auto;
  794. padding-bottom: 150rpx;
  795. .search_box {
  796. .inp_box {
  797. width: 572rpx;
  798. height: 80rpx;
  799. background-color: rgba(255, 255, 255, 0.4);
  800. border-radius: 44rpx;
  801. padding: 0 30rpx;
  802. box-sizing: border-box;
  803. input {
  804. width: 360rpx;
  805. height: 80rpx;
  806. line-height: 80rpx;
  807. color: #fff;
  808. }
  809. .search_button {
  810. width: 92rpx;
  811. height: 52rpx;
  812. background: linear-gradient(92deg, #FFA600 0%, #FCBC05 100%);
  813. opacity: 1;
  814. border-radius: 8rpx;
  815. color: #fff;
  816. }
  817. .iconfont {
  818. color: #fff;
  819. font-size: 40rpx;
  820. margin-right: 10rpx;
  821. }
  822. }
  823. .search_logo {
  824. width: 88rpx;
  825. height: 88rpx;
  826. }
  827. }
  828. .shop {
  829. // min-height: 446rpx;
  830. background: rgba(255, 255, 255, 1);
  831. box-shadow: 0px 6rpx 12rpx #eeeeee;
  832. border-radius: 24rpx;
  833. margin: 0rpx 0 30rpx;
  834. padding: 30rpx;
  835. box-sizing: border-box;
  836. .shop_top {
  837. display: flex;
  838. justify-content: space-between;
  839. align-items: flex-start;
  840. .store_img {
  841. width: 113rpx;
  842. height: 113rpx;
  843. border-radius: 16rpx;
  844. margin-right: 20rpx;
  845. flex-shrink: 0;
  846. }
  847. .shop_eval {
  848. font-size: 28rpx;
  849. color: #999;
  850. margin-top: 8rpx;
  851. text {
  852. margin-right: 8rpx;
  853. }
  854. }
  855. .edit {
  856. display: inline-block;
  857. width: 108rpx;
  858. height: 52rpx;
  859. font-size: 28rpx;
  860. text-align: center;
  861. line-height: 52rpx;
  862. color: $base-color;
  863. background: #fff4f3;
  864. margin-left: 12rpx;
  865. border-radius: 8rpx;
  866. }
  867. .iconfont {
  868. font-size: 28rpx;
  869. margin-right: 5rpx;
  870. }
  871. .login_btn {
  872. font-size: 32rpx;
  873. font-weight: bold;
  874. }
  875. button {
  876. border: 1px solid #fff;
  877. border-color: #fff;
  878. background: #fff;
  879. }
  880. button::after {
  881. border: none
  882. }
  883. }
  884. .shop_bottom {
  885. margin-top: 40rpx;
  886. >view {
  887. text-align: center;
  888. view:first-child {
  889. font-size: 40rpx;
  890. color: $base-color;
  891. font-weight: bold;
  892. }
  893. view:last-child {
  894. font-size: 28rpx;
  895. color: #999;
  896. margin-top: 10rpx;
  897. }
  898. }
  899. }
  900. .sub_btn {
  901. margin-top: 40rpx;
  902. }
  903. }
  904. .handle {
  905. display: flex;
  906. flex-wrap: wrap;
  907. justify-content: space-between;
  908. margin: 0 auto;
  909. box-sizing: border-box;
  910. .block_con {
  911. width: 48%;
  912. .block_box {
  913. width: 100%;
  914. height: 146rpx;
  915. background: #fff;
  916. border-radius: 18rpx;
  917. margin-bottom: 30rpx;
  918. padding: 0 20rpx;
  919. box-sizing: border-box;
  920. position: relative;
  921. .block_title {
  922. font-size: 38rpx;
  923. font-weight: bold;
  924. letter-spacing: 36rpx;
  925. }
  926. .block_intr {
  927. font-size: 28rpx;
  928. color: #999;
  929. margin-top: 10rpx;
  930. }
  931. .block_num {
  932. position: absolute;
  933. top: 10rpx;
  934. left: 140rpx;
  935. background: linear-gradient(48deg, #ffaa01 0%, #fe0000 100%);
  936. color: #fff;
  937. border-radius: 20rpx 20rpx 20rpx 0;
  938. padding: 4rpx 10rpx;
  939. }
  940. }
  941. }
  942. .block_con_red {
  943. .block_box {
  944. background: $base-line-bg;
  945. }
  946. .block_title,
  947. .block_intr {
  948. color: #fffdc1 !important;
  949. }
  950. }
  951. }
  952. .box {
  953. width: 702rpx;
  954. height: 200rpx;
  955. background: #fff;
  956. padding: 0 24rpx;
  957. box-sizing: border-box;
  958. border-radius: 16rpx;
  959. position: relative;
  960. .iconfont,
  961. .express_img {
  962. position: absolute;
  963. z-index: 999999;
  964. }
  965. .iconfont {
  966. font-size: 50rpx;
  967. color: #fff;
  968. top: -238rpx;
  969. right: 0rpx;
  970. }
  971. .express_img {
  972. width: 659rpx;
  973. height: 342rpx;
  974. top: -135rpx;
  975. right: -8rpx;
  976. }
  977. .box_item {
  978. display: flex;
  979. flex-direction: column;
  980. align-items: center;
  981. justify-content: center;
  982. background: #fff;
  983. .show_box {
  984. z-index: 999999;
  985. width: 180rpx;
  986. height: 180rpx;
  987. border-radius: 8rpx;
  988. }
  989. image {
  990. width: 100rpx;
  991. height: 100rpx;
  992. }
  993. view {
  994. font-size: 30rpx;
  995. margin-top: 10rpx;
  996. }
  997. }
  998. }
  999. .hint_img {
  1000. text-align: center;
  1001. margin-top: 30rpx;
  1002. .shop_hint {
  1003. width: 452rpx;
  1004. height: 54rpx;
  1005. }
  1006. }
  1007. .video {
  1008. width: 390rpx;
  1009. height: 112rpx;
  1010. margin: 10rpx auto 0;
  1011. background-size: 100% 100%;
  1012. position: relative;
  1013. z-index: 9999;
  1014. .finger {
  1015. width: 138rpx;
  1016. height: 128rpx;
  1017. z-index: 9999;
  1018. position: absolute;
  1019. top: 25rpx;
  1020. right: -120rpx;
  1021. }
  1022. .video_box {
  1023. width: 362rpx;
  1024. height: 84rpx;
  1025. border-radius: 8rpx;
  1026. z-index: 9999;
  1027. image {
  1028. width: 44rpx;
  1029. height: 44rpx;
  1030. margin-right: 10rpx;
  1031. z-index: 9999;
  1032. }
  1033. view {
  1034. font-size: 36rpx;
  1035. font-weight: bold;
  1036. color: $base-color;
  1037. z-index: 99999;
  1038. &::after {
  1039. content: '';
  1040. display: block;
  1041. width: 252rpx;
  1042. height: 20rpx;
  1043. margin-top: -12rpx;
  1044. background: linear-gradient(360deg, #fff709 0%, rgba(255, 242, 40, 0) 100%);
  1045. }
  1046. }
  1047. }
  1048. }
  1049. }
  1050. }
  1051. }
  1052. .popShow {
  1053. width: 100%;
  1054. height: 100vh;
  1055. position: fixed;
  1056. top: 0;
  1057. left: 0;
  1058. background-color: rgba(0, 0, 0, 0.7);
  1059. z-index: 999;
  1060. .popCon {
  1061. position: relative;
  1062. width: 634rpx;
  1063. height: 766rpx;
  1064. image {
  1065. width: 100%;
  1066. height: 100%;
  1067. }
  1068. .content {
  1069. position: absolute;
  1070. top: 0;
  1071. left: 0;
  1072. .title {
  1073. text-align: center;
  1074. font-size: 40rpx;
  1075. font-weight: bold;
  1076. padding: 76rpx 0 38rpx;
  1077. }
  1078. .opear_btn {
  1079. width: 100%;
  1080. margin-top: 75rpx;
  1081. view {
  1082. width: 242rpx;
  1083. text-align: center;
  1084. height: 88rpx;
  1085. border-radius: 44rpx;
  1086. font-size: 32rpx;
  1087. line-height: 88rpx;
  1088. background: $base-line-bg;
  1089. color: #fff;
  1090. }
  1091. view:first-child {
  1092. background: #e9e9e9;
  1093. color: #999;
  1094. }
  1095. }
  1096. }
  1097. }
  1098. }
  1099. .disagree {
  1100. width: 100%;
  1101. height: 100vh;
  1102. position: fixed;
  1103. top: 0;
  1104. left: 0;
  1105. background-color: rgba(0, 0, 0, 0.7);
  1106. z-index: 9999;
  1107. .dis_con {
  1108. width: 568rpx;
  1109. height: 270rpx;
  1110. background: #fff;
  1111. border-radius: 24rpx;
  1112. text-align: center;
  1113. >view:first-child {
  1114. font-size: 32rpx;
  1115. padding: 60rpx 0 40rpx;
  1116. }
  1117. >view:last-child {
  1118. width: 100%;
  1119. margin: 0 auto;
  1120. width: 302rpx;
  1121. text-align: center;
  1122. height: 76rpx;
  1123. line-height: 76rpx;
  1124. color: #fff;
  1125. background: $base-line-bg;
  1126. opacity: 1;
  1127. border-radius: 44rpx;
  1128. }
  1129. }
  1130. }
  1131. .poster {
  1132. width: 100%;
  1133. height: 100vh;
  1134. position: fixed;
  1135. top: 0;
  1136. left: 0;
  1137. background-color: rgba(0, 0, 0, 0.7);
  1138. z-index: 9999;
  1139. .pos_con {
  1140. width: 80%;
  1141. margin: 0 auto;
  1142. height: 100%;
  1143. position: relative;
  1144. image {
  1145. width: 572rpx;
  1146. height: 940rpx;
  1147. }
  1148. .qr_code {
  1149. position: absolute;
  1150. top: 630rpx;
  1151. left: 212rpx;
  1152. image {
  1153. width: 180rpx;
  1154. height: 180rpx;
  1155. }
  1156. }
  1157. .pos_info {
  1158. position: absolute;
  1159. bottom: 310rpx;
  1160. left: 92rpx;
  1161. image {
  1162. width: 104rpx;
  1163. height: 104rpx;
  1164. margin-right: 20rpx;
  1165. }
  1166. .pos_info_con {
  1167. view:first-child {
  1168. font-size: 36rpx;
  1169. font-weight: bold;
  1170. }
  1171. view {
  1172. margin-bottom: 5rpx;
  1173. }
  1174. }
  1175. }
  1176. .iconfont {
  1177. position: absolute;
  1178. top: 2vh;
  1179. right: -25rpx;
  1180. color: #dedede;
  1181. font-size: 60rpx;
  1182. z-index: 999;
  1183. }
  1184. .sub_btn {
  1185. margin-top: 76rpx;
  1186. }
  1187. }
  1188. }
  1189. .share_show {
  1190. width: 100%;
  1191. height: 100vh;
  1192. position: fixed;
  1193. top: 0;
  1194. left: 0;
  1195. background-color: rgba(0, 0, 0, 0.7);
  1196. z-index: 9999;
  1197. .share_con {
  1198. width: 80%;
  1199. margin: 0 auto;
  1200. height: 100%;
  1201. z-index: 999999;
  1202. .canvas {
  1203. width: 540rpx;
  1204. height: 900rpx;
  1205. position: relative;
  1206. #canvas {
  1207. width: 540rpx;
  1208. height: 900rpx;
  1209. position: absolute;
  1210. top: 0;
  1211. left: 0;
  1212. }
  1213. .poster_img {
  1214. -webkit-touch-callout: default;
  1215. width: 100%;
  1216. height: 100%;
  1217. display: block;
  1218. }
  1219. img[src=''],
  1220. img:not([src]) {
  1221. opacity: 0;
  1222. }
  1223. }
  1224. .save_img {
  1225. color: #fff;
  1226. width: 100%;
  1227. text-align: center;
  1228. font-size: 32rpx;
  1229. margin-top: 20rpx;
  1230. }
  1231. .iconfont {
  1232. position: absolute;
  1233. top: 4vh;
  1234. right: 25rpx;
  1235. color: #dedede;
  1236. font-size: 60rpx;
  1237. z-index: 999;
  1238. }
  1239. }
  1240. .sub_btn {
  1241. margin-top: 40rpx;
  1242. }
  1243. }
  1244. </style>