gzsq.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <view class="content">
  3. <view class="tab-wrapper">
  4. <view class="itemx">
  5. <view class="item-tit">公司名称:</view>
  6. <input type="text" v-model="companyname" placeholder="请输入公司名称" />
  7. </view>
  8. <view class="itemx">
  9. <view class="item-tit">负责人姓名:</view>
  10. <input type="text" v-model="name" placeholder="请输入负责人姓名" />
  11. </view>
  12. <view class="itemx">
  13. <view class="item-tit">联系方式:</view>
  14. <input type="text" v-model="phone" placeholder="请输入联系方式" />
  15. </view>
  16. <view class="itemx">
  17. <view class="item-tit">身份证号:</view>
  18. <input type="text" v-model="cardid" placeholder="请输入身份证号" />
  19. </view>
  20. </view>
  21. <view class="scsfz-wrap">
  22. <image v-if="imagezm == ''" src="../../static/img/sfzzm.png" mode="" @click="uploads('imagezm')"></image>
  23. <image v-if="imagezm != ''" :src="imagezm" mode="" @click="uploads('imagezm')"></image>
  24. <view class="" style="padding-bottom: 33rpx;">
  25. 添加身份证正面
  26. </view>
  27. <image v-if="imagefm == ''" src="../../static/img/sfzzm.png" mode="" @click="uploads('imagefm')"></image>
  28. <image v-if="imagefm != ''" :src="imagefm" mode="" @click="uploads('imagefm')"></image>
  29. <view class="">
  30. 添加身份证反面
  31. </view>
  32. </view>
  33. <view class="tab-wrapper" style="padding-top: 0;">
  34. <view class="itemx">
  35. <view class="item-tit">店铺地址:</view>
  36. <input type="text" v-model="address" placeholder="请输入店铺地址" />
  37. </view>
  38. <view class="itemx" style="height: 250rpx;">
  39. <view class="item-tit">营业执照:</view>
  40. <image v-if="yyzz == ''" src="../../static/img/add.png" mode="" @click="uploads('yyzz')"></image>
  41. <image v-if="yyzz != ''" :src="yyzz" mode="" @click="uploads('yyzz')"></image>
  42. </view>
  43. </view>
  44. <view class="tab-wrapper" style="padding-top: 0;">
  45. <view class="itemx" style="height: 250rpx;">
  46. <view class="item-tit">门店照片:</view>
  47. <image v-if="imageshop == ''" src="../../static/img/add.png" mode="" @click="uploads('imageshop')"></image>
  48. <image v-if="imageshop != ''" :src="imageshop" mode="" @click="uploads('imageshop')"></image>
  49. </view>
  50. </view>
  51. <view class="sq-xz" @click="dagou = !dagou">
  52. <text class="sq-gou" v-if="!dagou"></text>
  53. <image src="../../static/icon/gou.png" mode="" class="sq-gou-g" v-else></image>
  54. <text>我已阅读并同意</text><text style="color: #DC262B;">《馆长申请须知》</text>
  55. </view>
  56. <view class="sq-btn" @click="subSq()">
  57. 提交申请
  58. </view>
  59. <canvas canvas-id="canvas" v-if="canvasStatus"
  60. :style="{width: canvasWidth + 'px', height: canvasHeight + 'px',position: 'absolute',left:'-100000px',top:'-100000px'}"></canvas>
  61. <uni-popup ref="popup" type="center">
  62. <view class="alertprogress">
  63. {{progress}}%
  64. </view>
  65. </uni-popup>
  66. </view>
  67. </template>
  68. <script>
  69. import { upload } from '@/api/order.js';
  70. import { apply } from '@/api/user.js'
  71. export default {
  72. data() {
  73. return {
  74. dagou: true,
  75. companyname:'',//公司名称
  76. name:'',//负责人姓名
  77. phone:'',//联系方式
  78. cardid:'',//身份证号码
  79. imagezm:'',//身份证正面
  80. imagefm:'',//身份证反面
  81. address:'',//店铺地址
  82. yyzz:'',//营业执照
  83. imageshop:'',//门店照片
  84. upFileLoding:false,
  85. canvasStatus: false,
  86. canvasWidth:0,
  87. canvasHeight:0,
  88. progress:0,
  89. }
  90. },
  91. methods: {
  92. subSq() {
  93. let obj = this
  94. if(obj.companyname == ''){
  95. return this.$api.msg("请填写公司名称")
  96. }
  97. if(obj.name == ''){
  98. return this.$api.msg("请填写负责人姓名")
  99. }
  100. if(obj.phone == ''){
  101. return this.$api.msg("请填写联系方式")
  102. }
  103. if(obj.cardid == ''){
  104. return this.$api.msg("请填写身份证号码")
  105. }
  106. if(obj.imagezm == ''){
  107. return this.$api.msg("请填写身份证正面")
  108. }
  109. if(obj.imagefm == ''){
  110. return this.$api.msg("请填写身份证反面")
  111. }
  112. if(obj.address == ''){
  113. return this.$api.msg("请填写店铺地址")
  114. }
  115. if(obj.yyzz == ''){
  116. return this.$api.msg("请填写营业执照")
  117. }
  118. if(obj.imageshop == ''){
  119. return this.$api.msg("请填写门店照片")
  120. }
  121. // if(!obj.dagou) {
  122. // return this.$api.msg('')
  123. // }
  124. apply().then(({data}) =>{
  125. this.$api.msg('申请成功')
  126. })
  127. },
  128. uploads(type) {
  129. const that = this;
  130. if (that.upFileLoding) {
  131. return
  132. }
  133. that.upFileLoding = true;
  134. setTimeout(()=>{
  135. that.upFileLoding = false;
  136. },1000);
  137. that.canvasStatus = true;
  138. upload({
  139. filename: ''
  140. }, (res) => {
  141. that[type] = res[0].url;
  142. that.canvasStatus = false
  143. }, (res) => {
  144. that.canvasStatus = false
  145. }, (res) => {
  146. that.canvasWidth = res.w
  147. that.canvasHeight = res.h
  148. },(res)=>{
  149. // console.log(res,'res');
  150. if(res.progress==100){
  151. this.$refs.popup.close()
  152. uni.showToast({
  153. title: '上传成功'
  154. });
  155. }else if(res.progress==0){
  156. this.$refs.popup.open()
  157. }
  158. that.progress = res.progress;
  159. // console.log(res,'进度条');
  160. })
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss">
  166. .tab-wrapper {
  167. padding: 20rpx 30rpx;
  168. // background-color: #f2f3f5;
  169. }
  170. .itemx {
  171. margin: 0 auto;
  172. width: 100%;
  173. background-color: #fff !important;
  174. height: 100rpx;
  175. display: flex;
  176. // width: 690px;
  177. border: 1px #f4f4f4 solid;
  178. image {
  179. margin-top: 63rpx;
  180. margin-left: 55rpx;
  181. width: 160rpx;
  182. height: 160rpx;
  183. }
  184. .code {
  185. width: 150rpx;
  186. flex-shrink: 0;
  187. text-align: center;
  188. font-size: 28rpx;
  189. font-family: PingFang SC;
  190. font-weight: 500;
  191. color: #FF4C4C;
  192. line-height: 100rpx;
  193. }
  194. .item-tit {
  195. height: 100rpx;
  196. line-height: 100rpx;
  197. padding-left: 30rpx;
  198. width: 220rpx;
  199. font-size: 30rpx;
  200. font-family: PingFang SC;
  201. font-weight: 500;
  202. color: #666666;
  203. flex-shrink: 0;
  204. }
  205. input {
  206. width: 530rpx;
  207. padding-right: 20rpx;
  208. height: 100rpx;
  209. line-height: 100rpx;
  210. font-size: 30rpx;
  211. font-family: PingFang SC;
  212. font-weight: 500;
  213. color: #333333;
  214. }
  215. }
  216. .scsfz-wrap {
  217. width: 690rpx;
  218. height: 673rpx;
  219. background: #FFFFFF;
  220. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  221. border-radius: 10rpx;
  222. margin: 0 auto 20rpx;
  223. font-size: 29rpx;
  224. font-family: SourceHanSansCN;
  225. font-weight: 400;
  226. color: #B2B2B2;
  227. text-align: center;
  228. padding-top: 33rpx;
  229. image {
  230. display: block;
  231. width: 354rpx;
  232. height: 240rpx;
  233. margin: auto;
  234. }
  235. }
  236. .sq-btn {
  237. width: 750rpx;
  238. height: 98rpx;
  239. line-height: 98rpx;
  240. background: #DC262B;
  241. text-align: center;
  242. font-size: 36rpx;
  243. font-family: PingFang SC;
  244. font-weight: 500;
  245. color: #FFFFFF;
  246. }
  247. .sq-xz {
  248. height: 32rpx;
  249. line-height: 32rpx;
  250. display: flex;
  251. margin: 21rpx 0 75rpx 30rpx;
  252. font-size: 24rpx;
  253. font-family: PingFang SC;
  254. font-weight: 500;
  255. color: #0C1732;
  256. .sq-gou {
  257. display: inline-block;
  258. width: 32rpx;
  259. height: 32rpx;
  260. border-radius: 50%;
  261. border: 1px solid #999;
  262. margin-right: 15rpx;
  263. }
  264. .sq-gou-g {
  265. width: 32rpx;
  266. height: 32rpx;
  267. border-radius: 50%;
  268. margin-right: 15rpx;
  269. }
  270. }
  271. </style>