Qrcontract.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <view class="center">
  3. <scroll-view scroll-y="true" class="img-box">
  4. <image class="img" v-for="item in imgList" :src="item" mode="widthFix"></image>
  5. <image class="qm" :src="name" mode="aspectFit"></image>
  6. <text>
  7. </text>
  8. </scroll-view>
  9. <view class="buttom" @click="submit">
  10. <view class="btn">
  11. <text class="font">确认提交</text>
  12. </view>
  13. </view>
  14. <uni-popup ref="popup" type="center" @click="close">
  15. <view class="popup_row">
  16. <view class="title">
  17. <view class="title-left">
  18. 请输入您的手机号,开通{{ shop }}!
  19. </view>
  20. <view class="cancel" @click="cancel">
  21. <!-- <image src="../../static/img/cancel1.png" mode=""></image> -->
  22. </view>
  23. </view>
  24. <view class="inpBox">
  25. <input type="text" value="" placeholder="请输入您的手机号" v-model="to_phone"/>
  26. </view>
  27. <view class="inpedit">
  28. 可在方框中修改您的手机号
  29. </view>
  30. <view class="inpBox">
  31. <input type="text" value="" placeholder="请输入您的身份证号" v-model="Idcard"/>
  32. </view>
  33. <view class="inpedit">
  34. 可在方框中修改您的身份证号
  35. </view>
  36. <view class="comfirm">
  37. <view class="comfirm1" @click="comfirm1()">
  38. 确认
  39. </view>
  40. </view>
  41. </view>
  42. </uni-popup>
  43. </view>
  44. </template>
  45. <script>
  46. import { mapState, mapMutations } from 'vuex';
  47. import { apply } from '@/api/apply.js';
  48. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  49. import {
  50. upload1
  51. } from '@/api/apply.js';
  52. import { getSign, setSign, uploadSign } from '@/api/contract.js';
  53. import { xgxx } from '@/api/team.js'
  54. export default {
  55. data() {
  56. return {
  57. type:"",
  58. shoptype: '',
  59. to_phone: '',
  60. imgList:[],
  61. name: uni.getStorageSync('mycanvas'),
  62. id:'',
  63. url:'',
  64. shop:'',
  65. Idcard: ''
  66. }
  67. },
  68. onLoad(option) {
  69. this.type = option.type;
  70. if(option.type == 2){
  71. this.shoptype = 4;
  72. this.shop = '播主网店'
  73. }else if(option.type == 1){
  74. this.shoptype = 2;
  75. this.shop = '创业网店'
  76. }else{
  77. this.shoptype = option.type;
  78. this.shop = '创业播主网店'
  79. }
  80. this.loadData()
  81. },
  82. computed: {
  83. ...mapState(['userInfo']),
  84. },
  85. methods: {
  86. // 获取数据
  87. async loadData(){
  88. if (this.userInfo.phone != '') {
  89. this.to_phone = this.userInfo.phone;
  90. };
  91. if (this.userInfo.company == 1){
  92. this.to_phone = this.userInfo.company_info.company_phone;
  93. }
  94. if (this.userInfo.card_id != '') {
  95. this.Idcard = this.userInfo.card_id;
  96. };
  97. let url = uni.getStorageSync('mycanvas')
  98. //获取合同类容
  99. console.log(this.userInfo)
  100. if(this.userInfo.phone != ''){
  101. this.to_phone = this.userInfo.phone
  102. };
  103. if(this.userInfo.card_id != ''){
  104. this.Idcard = this.userInfo.card_id
  105. };
  106. getSign({},this.type).then(({data})=>{
  107. console.log('获取合同内容',data)
  108. this.imgList = data.pictures
  109. this.id = data.id
  110. this.type = data.type
  111. upload1({
  112. filename: url
  113. }).then(data => {
  114. console.log('---data---',data)
  115. this.url = data[0].url
  116. uploadSign({
  117. sign: this.url
  118. },this.id).then(({ data }) =>{
  119. console.log('123',data)
  120. })
  121. // this.imgY = uni.getStorageSync('mycanvas');
  122. })
  123. });
  124. },
  125. submit(){
  126. const obj = this;
  127. console.log(obj.userInfo)
  128. if ('store_info' in this.userInfo){
  129. if (this.shoptype == 3 && this.userInfo.store_info.type < 3){
  130. this.$refs.popup.open();
  131. }else if(this.shoptype == 2 && this.userInfo.store_info.type < 2) {
  132. this.$refs.popup.open();
  133. }else if(this.shoptype == 4 && this.userInfo.store_info.type < 4) {
  134. this.$refs.popup.open();
  135. }
  136. else {
  137. uni.navigateTo({
  138. url: '/pages/contract/success'
  139. })
  140. }
  141. }else {
  142. this.$refs.popup.open();
  143. }
  144. },
  145. comfirm1:function () {
  146. let obj = this
  147. if ( obj.to_phone.toString().trim() == '' ){
  148. obj.$api.msg('请填写正确的手机号码');
  149. // uni.showModal({
  150. // title:'输入框为空',
  151. // // content:JSON.stringify(obj)
  152. // })
  153. } else {
  154. console.log('obj.to_phone1111',obj.to_phone)
  155. const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
  156. if (!reg.test(obj.to_phone)) {
  157. obj.$api.msg('请填写正确的手机号码');
  158. return;
  159. }
  160. let reg1 =
  161. /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
  162. if (!reg1.test(obj.Idcard)) {
  163. obj.$api.msg('请填写正确的身份证信息');
  164. return;
  165. }
  166. xgxx({
  167. card_id: obj.Idcard,
  168. }).then(e =>{
  169. console.log(e)
  170. }).catch(e => {
  171. console.log(e)
  172. })
  173. let data = {}
  174. if (obj.userInfo.company == 1){
  175. data = {
  176. name: obj.userInfo.company_info.company_name,
  177. introduction: obj.userInfo.company_info.jobs,
  178. image: obj.userInfo.avatar,
  179. phone: obj.to_phone || '',
  180. card_id: obj.Idcard,
  181. type: obj.shoptype
  182. }
  183. }else {
  184. data = {
  185. name: obj.userInfo.nickname + "的网店",
  186. introduction: obj.userInfo.nickname + "的网店",
  187. image: obj.userInfo.avatar,
  188. phone: obj.to_phone || '',
  189. card_id: obj.Idcard,
  190. type: obj.shoptype
  191. }
  192. }
  193. apply(data)
  194. .then(({ data }) =>{
  195. this.$refs.popup.close();
  196. console.log(data)
  197. uni.navigateTo({
  198. url: '/pages/contract/success'
  199. })
  200. })
  201. .catch((err) => {
  202. this.$refs.popup.close();
  203. })
  204. }
  205. }
  206. }
  207. }
  208. </script>
  209. <style lang="scss">
  210. page{
  211. height: 100%;
  212. background-color: #fff;
  213. }
  214. .title {
  215. margin-top: 34rpx;
  216. margin-bottom: 33rpx;
  217. width: 100%;
  218. height: 35rpx;
  219. font-size: 38rpx;
  220. font-family: SimSun;
  221. font-weight: 400;
  222. color: #333333;
  223. line-height: 1;
  224. text-align: center;
  225. }
  226. .certificates{
  227. // padding: 24rpx;
  228. width: 100%;
  229. height: 100vh;
  230. }
  231. .img-box{
  232. width: 100%;
  233. display: flex;
  234. flex-direction: column;
  235. position: relative;
  236. .img{
  237. width: 100%;
  238. // height: 1035rpx;
  239. z-index: 99;
  240. }
  241. }
  242. .tki-qrcode-canvas {
  243. width: 750rpx;
  244. // height: 1350rpx;
  245. margin: 0 auto;
  246. z-index: 99;
  247. }
  248. .imgbox{
  249. height: 1350rpx;
  250. width:750rpx;
  251. }
  252. .text {
  253. width: 90%;
  254. margin: 0 auto;
  255. height: calc(100% - 44px);
  256. font-size: 26rpx;
  257. font-family: SimSun;
  258. font-weight: 400;
  259. color: #333333;
  260. line-height: 40rpx;
  261. }
  262. .buttom {
  263. padding: 133rpx 0 28rpx 0;
  264. .btn {
  265. width: 100%;
  266. margin: auto;
  267. width: 674rpx;
  268. height: 88rpx;
  269. background: #FF3939;
  270. border-radius: 44rpx;
  271. color: #FFE1E1;
  272. line-height: 88rpx;
  273. text-align: center;
  274. .font {
  275. font-size: 36rpx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #FFFFFF;
  279. }
  280. }
  281. }
  282. .qm {
  283. // width: 750rpx;
  284. // height: 300rpx;
  285. // position: absolute;
  286. // bottom: 0rpx;
  287. // left: 0rpx;
  288. // // z-index: 999;
  289. // background-color: pink;
  290. width: 310rpx;
  291. height: 128rpx;
  292. position: absolute;
  293. bottom: 200rpx;
  294. left: 239rpx;
  295. z-index: 99;
  296. }
  297. .popup_row{
  298. // margin-top: 108rpx;
  299. position: relative;
  300. border-radius: 25rpx;
  301. width: 100%;
  302. padding: 24rpx;
  303. background-color: #f8f8f8;
  304. z-index: 999;
  305. .title{
  306. border-bottom: 2rpx solid #F2F2F2;
  307. color: #E63931;
  308. font-size: 32rpx;
  309. padding-left: 4rpx;
  310. padding-bottom: 16rpx;
  311. display: flex;
  312. justify-content: space-between;
  313. // align-items: center;
  314. .cancel{
  315. margin-left: 52rpx;
  316. width: 36rpx;
  317. height: 36rpx;
  318. image{
  319. width: 36rpx;
  320. height: 36rpx;
  321. }
  322. }
  323. }
  324. .inpBox{
  325. margin-top: 52rpx;
  326. border: 2px solid #f2f2f2;
  327. padding: 12rpx 24rpx;
  328. color: #FF9797;
  329. border-radius: 8rpx;
  330. .input-placeholder {
  331. // height: 70rpx;
  332. font-size: 32rpx;
  333. color: #FF9797;
  334. }
  335. }
  336. .inpedit{
  337. margin-top: 24rpx;
  338. margin-left: 14rpx;
  339. font-size: 28rpx;
  340. color: #FF9797;
  341. }
  342. .comfirm{
  343. display: flex;
  344. justify-content: flex-end;
  345. margin-top: 54rpx;
  346. .comfirm1{
  347. padding: 12rpx 24rpx;
  348. border-radius: 12rpx;
  349. color: #FFFFFF;
  350. background-color: #E63931;
  351. }
  352. }
  353. }
  354. </style>