青蛙卖大米小程序2024-11-24
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.

407 lines
8.2 KiB

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