珠宝小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

404 lines
8.1 KiB

3 months ago
  1. <template>
  2. <view class="applyLaundryStore">
  3. <navbar title="成为渠道商" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <view class="title">
  6. <!-- <view class="title-nav"> -->
  7. <view class="heeng"></view>
  8. 成为渠道商
  9. </view>
  10. <view class="desc">
  11. <!-- configList.qu_price -->
  12. <!-- <uv-parse :content="configList.qu_price"></uv-parse> -->
  13. {{ configList.qu_price_keyValue }}
  14. <br />
  15. {{ configList.qu_price_money_keyValue }}
  16. </view>
  17. </view>
  18. <view class="frame">
  19. <view class="title">
  20. <view class="heeng"></view>
  21. <view>申请信息</view>
  22. </view>
  23. <view class="shopName">
  24. <view>类型</view>
  25. <view>
  26. <uv-radio-group v-model="form.type">
  27. <uv-radio
  28. v-for="(item, index) in typeList"
  29. :key="index"
  30. :customStyle="{margin: '16rpx'}"
  31. size="40rpx"
  32. iconSize="30rpx"
  33. labelSize="30rpx"
  34. :disabled="isUpdate"
  35. :label="item.name"
  36. :name="item.type">
  37. </uv-radio>
  38. </uv-radio-group>
  39. </view>
  40. </view>
  41. <view class="shopName">
  42. <view style="width: 300rpx;"
  43. v-if="form.type">身份证正反面</view>
  44. <view style="width: 300rpx;"
  45. v-else>营业执照</view>
  46. <view>
  47. <uv-upload
  48. :fileList="fileList"
  49. name="fileList"
  50. :maxCount="2"
  51. width="180rpx"
  52. height="180rpx"
  53. :disabled="isUpdate"
  54. multiple
  55. @afterRead="afterRead"
  56. @delete="deleteImage">
  57. </uv-upload>
  58. </view>
  59. </view>
  60. <view class="shopName"
  61. v-if="form.type">
  62. <view>姓名</view>
  63. <view>
  64. <input v-model="form.name"
  65. :disabled="isUpdate" placeholder="请输入姓名" clearable></input>
  66. </view>
  67. </view>
  68. <view class="shopName"
  69. v-else>
  70. <view>企业名称</view>
  71. <view>
  72. <input v-model="form.name"
  73. :disabled="isUpdate" placeholder="请输入企业名称" clearable></input>
  74. </view>
  75. </view>
  76. <view class="shopName"
  77. v-if="form.type">
  78. <view>性别</view>
  79. <view>
  80. <uv-radio-group v-model="form.sex">
  81. <uv-radio
  82. v-for="(item, index) in sexList"
  83. :key="index"
  84. :customStyle="{margin: '16rpx'}"
  85. size="40rpx"
  86. iconSize="30rpx"
  87. :disabled="isUpdate"
  88. labelSize="30rpx"
  89. :label="item.name"
  90. :name="item.name">
  91. </uv-radio>
  92. </uv-radio-group>
  93. </view>
  94. </view>
  95. <view class="shopName">
  96. <view>手机号</view>
  97. <view>
  98. <input v-model="form.phone"
  99. :disabled="isUpdate" type="number" placeholder="请输入手机号" clearable></input>
  100. </view>
  101. </view>
  102. <view class="shopName" v-if="form.type">
  103. <view>身份证号码</view>
  104. <view>
  105. <input v-model="form.no"
  106. :disabled="isUpdate" placeholder="请输入身份证号码" clearable></input>
  107. </view>
  108. </view>
  109. <view class="shopName" v-else>
  110. <view>社会信用代码</view>
  111. <view>
  112. <input v-model="form.no"
  113. :disabled="isUpdate" placeholder="请输入社会信用统一代码" clearable></input>
  114. </view>
  115. </view>
  116. <view class="shopName">
  117. <view>邮寄地址</view>
  118. <view>
  119. <input v-model="form.address"
  120. :disabled="isUpdate" placeholder="请输入邮寄地址" clearable></input>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="config">
  125. <uv-checkbox-group
  126. v-model="checkboxValue"
  127. shape="circle">
  128. <view class="content">
  129. <view
  130. style="display: flex;">
  131. <uv-checkbox
  132. size="40rpx"
  133. icon-size="30rpx"
  134. activeColor="#A3D250"
  135. :name="1"
  136. ></uv-checkbox>
  137. 阅读并同意我们的<text @click="$refs.popup.open('shop_user_xy')">合作协议</text>
  138. </view>
  139. </view>
  140. </uv-checkbox-group>
  141. </view>
  142. <!-- 底部按钮 -->
  143. <view class="uni-color-btn"
  144. @click="submitApplication"
  145. v-if="!isUpdate">
  146. 提交
  147. </view>
  148. <configPopup ref="popup"></configPopup>
  149. </view>
  150. </template>
  151. <script>
  152. import Position from '@/utils/position.js'
  153. export default {
  154. components: {
  155. },
  156. data() {
  157. return {
  158. checkboxValue : [],
  159. form: {
  160. userName: '',
  161. name: '',
  162. phone: '',
  163. sex : '男',
  164. type : 0,
  165. state : 0,
  166. },
  167. fileList: [],
  168. sexList : [
  169. {
  170. name: '男',
  171. },
  172. {
  173. name: '女',
  174. },
  175. ],
  176. typeList : [
  177. {
  178. name: '企业',
  179. type : 0,
  180. },
  181. {
  182. name: '个人',
  183. type : 1,
  184. },
  185. ],
  186. }
  187. },
  188. computed: {
  189. isUpdate(){
  190. return this.form.state == 1
  191. },
  192. },
  193. onShow() {
  194. },
  195. onLoad() {
  196. this.getData()
  197. },
  198. methods: {
  199. deleteImage(e){
  200. this[e.name].splice(e.index, 1)
  201. },
  202. afterRead(e){
  203. let self = this
  204. e.file.forEach(file => {
  205. self.$Oss.ossUpload(file.url).then(url => {
  206. self[e.name].push({
  207. url
  208. })
  209. })
  210. })
  211. },
  212. // 提交按钮
  213. submitApplication() {
  214. if(!this.checkboxValue.length){
  215. return uni.showToast({
  216. title: '请先同意合作协议',
  217. icon:'none'
  218. })
  219. }
  220. this.form.image = this.fileList.map((item) => item.url).join(",")
  221. let p = {
  222. image: '请上传营业执照',
  223. name: '请输入您的企业名称',
  224. phone: '请输入联系电话',
  225. no: '请输入社会信用代码',
  226. address: '请输入邮寄地址',
  227. }
  228. if(this.form.type){
  229. p.no = '请输入身份证号码'
  230. p.name = '请输您的入姓名'
  231. p.image = '请上传身份证正反面'
  232. }
  233. if (this.$utils.verificationAll(this.form, p)) {
  234. return
  235. }
  236. if(!this.$utils.verificationPhone(this.form.phone)){
  237. return uni.showToast({
  238. title: '手机号格式不正确',
  239. icon:'none'
  240. })
  241. }
  242. this.$api('addOrUpdateCommonUser', this.form, res => {
  243. if (res.code == 200) {
  244. uni.showToast({
  245. title: '申请成功待审核', // 提示的内容
  246. icon: 'success', // 图标,可选值有 'success', 'loading', 'none'
  247. duration: 1500 // 提示的持续时间,默认是1500毫秒
  248. });
  249. setTimeout(uni.navigateBack, 1000, -1)
  250. }
  251. })
  252. },
  253. getData(){
  254. this.$api('getCommonUser', res => {
  255. if(res.code == 200){
  256. this.form = res.result || this.form
  257. if(!this.form.id){
  258. return
  259. }
  260. delete this.form.userId
  261. delete this.form.createTime
  262. delete this.form.createBy
  263. delete this.form.state
  264. delete this.form.updateBy
  265. delete this.form.updateTime
  266. res.result.image && res.result.image.split(',')
  267. .forEach(url => {
  268. this.fileList.push({
  269. url
  270. })
  271. })
  272. }
  273. })
  274. },
  275. }
  276. }
  277. </script>
  278. <style lang="scss" scoped>
  279. * {
  280. box-sizing: border-box;
  281. }
  282. .heeng{
  283. width: 10rpx;
  284. height: 40rpx;
  285. background-color: #f78142;
  286. border-radius: 10rpx;
  287. overflow: hidden;
  288. margin-right: 10rpx;
  289. }
  290. .applyLaundryStore {
  291. background-color: #f5f5f5;
  292. .frame {
  293. display: flex;
  294. flex-direction: column;
  295. gap: 20rpx;
  296. background-color: #FFF;
  297. margin-top: 20rpx;
  298. padding: 20rpx;
  299. .title-nav{
  300. text-align: center;
  301. font-size: 40rpx;
  302. font-weight: 900;
  303. }
  304. .desc{
  305. padding: 0 20rpx;
  306. font-size: 28rpx;
  307. line-height: 46rpx;
  308. }
  309. .title {
  310. display: flex;
  311. // padding-top: 40rpx;
  312. font-size: 34rpx;
  313. font-weight: 700;
  314. padding: 0 0 0 20rpx;
  315. >span:nth-of-type(1) {
  316. margin: 4rpx 0 0 8rpx;
  317. background-color: #FFF;
  318. }
  319. >span:nth-of-type(2) {
  320. margin: 0 0 0 8rpx;
  321. background-color: #FFF;
  322. }
  323. }
  324. .shopName {
  325. display: flex;
  326. align-items: center;
  327. background-color: #FFF;
  328. // margin: 10rpx 0 0 0;
  329. padding: 10rpx 0 0 20rpx;
  330. >view:nth-of-type(1) {
  331. width: 30%;
  332. // font-weight: 700;
  333. }
  334. >view:nth-of-type(2) {
  335. width: 70%;
  336. // padding: 0 20rpx 0 0;
  337. border-radius: 10rpx;
  338. overflow: hidden;
  339. input {
  340. background-color: #f5f5f5;
  341. // color: #a4a4a4;
  342. font-size: 28rpx;
  343. padding: 8rpx 8rpx 8rpx 15rpx;
  344. }
  345. }
  346. }
  347. }
  348. .config{
  349. font-size: 26rpx;
  350. padding: 20rpx;
  351. /deep/ .uv-checkbox-group{
  352. display: flex;
  353. justify-content: center;
  354. }
  355. text{
  356. color: $uni-color;
  357. }
  358. }
  359. }
  360. </style>