index.vue 12 KB

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