index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <template>
  2. <view class="amountopening">
  3. <view class="amountopening-back">
  4. <image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810090332606.png" mode="widthFix"></image>
  5. <view class="amountopening-header">
  6. <view class="amountopening-header-icon" @click="returns">
  7. <image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810090600249.png" mode="widthFix">
  8. </image>
  9. </view>
  10. <view class="amountopening-header-text">
  11. 开通商户
  12. </view>
  13. </view>
  14. <view class="amountopening-icon">
  15. <image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810090719212.png" mode="widthFix"></image>
  16. <view class="amountopening-jinggao">
  17. <view class="amountopening-jinggao-top">
  18. 开通电商商户
  19. </view>
  20. <view class="amountopening-jinggao-bot">
  21. ¥4980/年
  22. </view>
  23. </view>
  24. <view class="amountopening-kaiqi">
  25. <view class="amountopening-kaiqi-text">
  26. 开通商户立享八项功能权益
  27. </view>
  28. <view class="amountopening-kaiqi-iocnr" @click="activiteCard = false">
  29. 我有激活码
  30. </view>
  31. <!-- <view class="amountopening-kaiqi-iocnr" @click="payment">
  32. 我有激活码
  33. </view> -->
  34. </view>
  35. </view>
  36. </view>
  37. <view class="amountopening-quanyi">
  38. 尊享权益
  39. </view>
  40. <view class="amountopening-list">
  41. <view class="amountopening-list-is" v-for="(item,index) in mus" :key="index">
  42. <view class="amountopening-list-is-top">
  43. <image :src="item.url" mode="widthFix"></image>
  44. </view>
  45. <view class="amountopening-list-is-bto">
  46. {{item.name}}
  47. </view>
  48. </view>
  49. </view>
  50. <!-- <view class="amountopening-kaitong" @click="payment">
  51. <image src="https://cdn.bjtdba.com/vod/image/2022-08-10/20220810105617180.png" mode="widthFix">
  52. </image>
  53. <view class="kaitong-amount">
  54. <span class="kaitong-money">¥3990</span>
  55. <span>/年</span>
  56. </view>
  57. </view> -->
  58. <view class="amountopening-anniu" @click="payment">
  59. 立即开通
  60. </view>
  61. <view :class="[activiteCard ? 'dis-activite' : '', 'activite-code' ]" @touchmove.stop.prevent="moveHandle">
  62. <view class="activite-code-mask" @click="activiteCard = true"></view>
  63. <view class="bottomss">
  64. <view class="top">
  65. 兑换激活码
  66. </view>
  67. <view class="cv">
  68. <view class="cv-title">输入激活码,兑换幸福保商户</view>
  69. <input class="cv-input" type="text" placeholder="输入激活码" v-model="useCode">
  70. </view>
  71. <view class="ft" @click="immediateUse">
  72. 立即使用
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. updateActivationCode,
  81. insterMerchantOrder,
  82. selectMerchant
  83. } from '@/commit/api.js';
  84. export default {
  85. data() {
  86. return {
  87. userinfo: [],
  88. activiteCard: true,
  89. useCode: '',
  90. code: '',
  91. mus: [{
  92. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101724170.png',
  93. name: '线上商城'
  94. },
  95. {
  96. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101550963.png',
  97. name: '店务管理'
  98. },
  99. {
  100. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101703873.png',
  101. name: '锁定客户'
  102. },
  103. {
  104. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101751275.png',
  105. name: '员工管理'
  106. },
  107. {
  108. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101615531.png',
  109. name: '经营报表'
  110. },
  111. {
  112. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101653529.png',
  113. name: '数据分析'
  114. },
  115. {
  116. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101604267.png',
  117. name: '会员管理'
  118. },
  119. {
  120. url: 'https://cdn.bjtdba.com/vod/image/2022-08-10/20220810101713873.png',
  121. name: '推广引流'
  122. },
  123. ]
  124. }
  125. },
  126. onLoad() {
  127. this.userinfo = uni.getStorageSync('userinfo')
  128. },
  129. onShow() {
  130. },
  131. methods: {
  132. moveHandle() {},
  133. returns() {
  134. uni.redirectTo({
  135. url: "/openmerchant/guide/index"
  136. })
  137. },
  138. immediateUse() {
  139. if (this.useCode == "") return uni.showToast({
  140. title: "请输入激活码",
  141. icon: "none"
  142. });
  143. updateActivationCode({
  144. code: this.useCode,
  145. uid: this.userinfo.uid
  146. }).then(res => {
  147. console.log('激活码激活 -->',res)
  148. if (res.data.status == 200) {
  149. this.useCode = "";
  150. this.activiteCard = true;
  151. //获取merId进行存储
  152. let UserSelectmerchant = uni.getStorageSync('selectmerchant')
  153. let selectmerchant = {
  154. status:UserSelectmerchant.status,
  155. merId:res.data.data.mer_id,
  156. pay_type:res.data.data.pay_type,
  157. msg:UserSelectmerchant.msg
  158. }
  159. if(res.data.data.pay_type=="2"){
  160. this.$store.commit('changeMerchantsStatus', 1);
  161. }
  162. uni.setStorageSync('selectmerchant', selectmerchant);
  163. uni.redirectTo({
  164. url: "/openmerchant/shopentry/process?mer_id=" + res.data.mer_id
  165. })
  166. }
  167. }, fail => {
  168. console.log('激活码激活 -->',fail)
  169. })
  170. },
  171. payment() {
  172. // uni.showToast({
  173. // title: '升级中',
  174. // icon: "none"
  175. // });
  176. let userInfo = uni.getStorageSync('userinfo')
  177. // 用户状态判断
  178. selectMerchant({
  179. uid: userInfo.uid
  180. }).then(data => {
  181. console.log('data = ',data)
  182. if (data.data.status == 200) {
  183. if (data.data.data.status == -1) {
  184. this.pushToUserApplet()
  185. } else {
  186. uni.redirectTo({
  187. url: '/openmerchant/shopentry/process?mer_id=' + data.data.data.merId //已开通商户未填写资料
  188. });
  189. return
  190. }
  191. }
  192. }, fail => {
  193. uni.showToast({
  194. title: fail,
  195. icon: "none"
  196. })
  197. }).catch(err => {
  198. console.log(err)
  199. })
  200. },
  201. pushToUserApplet() {
  202. uni.showToast({
  203. title: '请使用激活码开通',
  204. icon: "none"
  205. })
  206. uni.navigateToMiniProgram({
  207. // appid 写你要跳转的小程序的 appid
  208. appId:'wx9082e5ac2fdb513f',
  209. // 路径写 src下的路径,假如你跳转的是pages下的页面,就可以写pages/index
  210. // path: 'pagesA/oderPay/oder_nian',
  211. path: 'pages/chuangke/index?type=100',
  212. // 这个不写的话会显示开发环境,不能正常跳转,写上就能正常跳转了
  213. envVersion: 'trial', // develop(开发版),trial(体验版),release(正式版)
  214. // envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
  215. success(res) {
  216. // 打开成功
  217. uni.showToast({
  218. title: '跳转成功'
  219. })
  220. },
  221. fail(err) {
  222. console.log(err)
  223. // 打开失败/取消
  224. uni.showToast({
  225. title: '跳转不成功'
  226. })
  227. }
  228. })
  229. },
  230. pay(appId, timeStamp, nonceStr, pack, signType, paySign) {
  231. wx.requestPayment({
  232. 'appId': appId,
  233. 'timeStamp': timeStamp,
  234. 'nonceStr': nonceStr,
  235. 'package': pack,
  236. 'signType': signType,
  237. 'paySign': paySign,
  238. success: function(res) {
  239. uni.showToast({
  240. title: "支付成功",
  241. icon: 'none',
  242. })
  243. this.$store.commit('changeMerchantsStatus', 0);
  244. uni.redirectTo({
  245. url: "/openmerchant/shopentry/process?mer_id=539"
  246. })
  247. },
  248. fail: function(res) {
  249. uni.showToast({
  250. title: res.data,
  251. duration: 2000
  252. })
  253. },
  254. })
  255. }
  256. }
  257. }
  258. </script>
  259. <style lang="scss" scoped>
  260. .amountopening {
  261. width: 100%;
  262. height: 100%;
  263. display: flex;
  264. flex-direction: column;
  265. align-items: center;
  266. justify-content: center;
  267. .amountopening-back {
  268. width: 100%;
  269. height: 347rpx;
  270. position: relative;
  271. display: flex;
  272. justify-content: center;
  273. image {
  274. width: 100%;
  275. height: 100%;
  276. }
  277. .amountopening-header {
  278. position: absolute;
  279. width: 686rpx;
  280. height: 100rpx;
  281. // top: 37rpx;
  282. display: flex;
  283. justify-content: flex-start;
  284. align-items: center;
  285. .amountopening-header-icon {
  286. width: 36rpx;
  287. height: 36rpx;
  288. image {
  289. width: 100%;
  290. height: 100%;
  291. }
  292. }
  293. .amountopening-header-text {
  294. font-size: 36rpx;
  295. font-weight: 500;
  296. color: #FFFFFF;
  297. margin-left: 26rpx;
  298. }
  299. }
  300. .amountopening-icon {
  301. width: 686rpx;
  302. height: 320rpx;
  303. position: absolute;
  304. top: 108rpx;
  305. image {
  306. width: 100%;
  307. height: 100%;
  308. }
  309. .amountopening-jinggao {
  310. position: absolute;
  311. top: 36rpx;
  312. left: 32rpx;
  313. height: 99rpx;
  314. display: flex;
  315. flex-direction: column;
  316. justify-content: space-between;
  317. align-items: flex-start;
  318. .amountopening-jinggao-top {
  319. font-size: 42rpx;
  320. font-weight: 500;
  321. color: #333333;
  322. }
  323. .amountopening-jinggao-bot {
  324. font-size: 38rpx;
  325. font-weight: 400;
  326. color: #333333;
  327. }
  328. }
  329. .amountopening-kaiqi {
  330. position: absolute;
  331. width: 622rpx;
  332. left: 32rpx;
  333. bottom: 28rpx;
  334. display: flex;
  335. justify-content: space-between;
  336. align-items: center;
  337. .amountopening-kaiqi-text {
  338. font-size: 28rpx;
  339. font-weight: 400;
  340. color: #333333;
  341. }
  342. .amountopening-kaiqi-iocnr {
  343. width: 189rpx;
  344. height: 64rpx;
  345. background: linear-gradient(175deg, #FFF8E0 0%, #EAD6AE 100%);
  346. border-radius: 31px;
  347. line-height: 64rpx;
  348. text-align: center;
  349. font-size: 28rpx;
  350. font-weight: 400;
  351. color: #333333;
  352. }
  353. }
  354. }
  355. }
  356. .amountopening-quanyi {
  357. width: 686rpx;
  358. font-size: 36rpx;
  359. font-weight: 500;
  360. color: #333333;
  361. margin-top: 113rpx;
  362. display: flex;
  363. justify-content: flex-start;
  364. }
  365. .amountopening-list {
  366. width: 686rpx;
  367. // height: 555rpx;
  368. border-radius: 16rpx;
  369. border: 1rpx solid #FEB84A;
  370. margin-top: 32rpx;
  371. display: flex;
  372. flex-wrap: wrap;
  373. .amountopening-list-is {
  374. width: 110rpx;
  375. height: 131rpx;
  376. display: flex;
  377. margin: 12rpx 31rpx 12rpx 31rpx;
  378. flex-direction: column;
  379. justify-content: space-between;
  380. align-items: center;
  381. .amountopening-list-is-top {
  382. width: 86rpx;
  383. height: 86rpx;
  384. image {
  385. width: 100%;
  386. height: 100%;
  387. }
  388. }
  389. .amountopening-list-is-bto {
  390. font-size: 26rpx;
  391. font-weight: 400;
  392. color: #333333;
  393. }
  394. }
  395. }
  396. .amountopening-kaitong {
  397. width: 686rpx;
  398. height: 88rpx;
  399. margin-top: 280rpx;
  400. position: relative;
  401. image {
  402. width: 100%;
  403. height: 100%;
  404. }
  405. .kaitong-amount {
  406. position: absolute;
  407. top: 20rpx;
  408. left: 175rpx;
  409. color: #FFFFFF;
  410. font-size: 32rpx;
  411. line-height: 48rpx;
  412. display: flex;
  413. .kaitong-money {
  414. color: #FBDD99;
  415. font-size: 48rpx;
  416. margin-right: 8rpx;
  417. }
  418. }
  419. }
  420. .amountopening-anniu{
  421. width: 686rpx;
  422. height: 88rpx;
  423. background: #45495A;
  424. border-radius: 44rpx;
  425. text-align: center;
  426. line-height: 88rpx;
  427. font-size: 32rpx;
  428. font-weight: 600;
  429. color: #FFFFFF;
  430. margin-top: 343rpx;
  431. }
  432. .dis-activite {
  433. display: none !important;
  434. }
  435. .activite-code {
  436. width: 100%;
  437. height: 100%;
  438. background: transparent;
  439. position: fixed;
  440. margin: auto;
  441. left: 0;
  442. right: 0;
  443. top: 0;
  444. bottom: 0;
  445. z-index: 111;
  446. display: flex;
  447. justify-content: center;
  448. align-items: center;
  449. .activite-code-mask {
  450. width: 100%;
  451. height: 100%;
  452. background: rgba(0, 0, 0, 0.5);
  453. position: fixed;
  454. }
  455. .bottomss {
  456. width: 560rpx;
  457. // height: 408rpx;
  458. background: #FFFFFF;
  459. border-radius: 16rpx;
  460. text-align: center;
  461. padding-top: 50rpx;
  462. z-index: 112;
  463. .top {
  464. font-size: 36rpx;
  465. }
  466. .cv {
  467. width: 100%;
  468. box-sizing: border-box;
  469. padding: 35rpx 22rpx 40rpx 26rpx;
  470. border-bottom: 1rpx solid #E5E5E5;
  471. text-align: left;
  472. .cv-title {
  473. font-size: 30rpx;
  474. margin-bottom: 32rpx;
  475. }
  476. .cv-input {
  477. border-radius: 8rpx;
  478. border: 2px solid #999999;
  479. width: 508rpx;
  480. height: 86rpx;
  481. padding-left: 25rpx;
  482. box-sizing: border-box;
  483. font-size: 26rpx;
  484. }
  485. }
  486. .ft {
  487. width: 100%;
  488. padding: 31rpx 0;
  489. color: #1F7CFF;
  490. font-size: 36rpx;
  491. }
  492. }
  493. }
  494. }
  495. </style>