register_3.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view>
  3. <u-form :model="form">
  4. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  5. <view slot="head">
  6. <view class="u-flex">
  7. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  8. 选择合作品牌
  9. </view>
  10. </view>
  11. <view slot="body">
  12. <u-form-item prop="cooperation">
  13. <view style="margin-right: 10rpx;">
  14. <u-icon name="order" size="36"></u-icon>
  15. </view>
  16. <u-input placeholder="点击选择合作品牌" :disabled="true" @click="show = true;" v-model="form.cooperation"></u-input>
  17. <view class="" slot="right">
  18. <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
  19. </view>
  20. </u-form-item>
  21. </view>
  22. </u-card>
  23. <u-popup mode="bottom" v-model="show">
  24. <view class="u-flex u-row-between u-padding-left-40 u-padding-right-40" style="height: 90rpx;" @click="show = false;">
  25. <view style="padding: 16rpx;font-size:30rpx">
  26. 取消
  27. </view>
  28. <view style="padding: 16rpx;color:#0095FF;font-size:30rpx" @click="getCooperation">
  29. 确认
  30. </view>
  31. </view>
  32. <u-line color="#e4e7ed"></u-line>
  33. <view class="content">
  34. <scroll-view scroll-y="true" style="height: 300rpx;">
  35. <view class="u-flex u-row-center">
  36. <u-checkbox-group :wrap="true" @change="checkboxGroupChange">
  37. <u-checkbox v-model="item.checked" v-for="(item, index) in brandList" :key="index" :name="item.name" shape="circle">{{item.name}}</u-checkbox>
  38. </u-checkbox-group>
  39. </view>
  40. </scroll-view>
  41. </view>
  42. </u-popup>
  43. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  44. <view slot="head">
  45. <view class="u-flex">
  46. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  47. 已选合作品牌
  48. </view>
  49. </view>
  50. <view slot="body">
  51. <view class="u-flex u-flex-wrap u-row-around">
  52. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  53. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  54. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  55. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  56. </view>
  57. </view>
  58. </u-card>
  59. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  60. <view slot="head">
  61. <view class="u-flex">
  62. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  63. 赛轮合作品牌签约任务
  64. </view>
  65. </view>
  66. <view slot="body">
  67. <u-form-item>
  68. <view style="margin-right: 10rpx;">
  69. <u-icon name="account" size="36"></u-icon>
  70. </view>
  71. <view class="">
  72. 某某代理商
  73. </view>
  74. </u-form-item>
  75. <u-form-item prop="lists">
  76. <view style="margin-right: 10rpx;">
  77. <u-icon name="order" size="36"></u-icon>
  78. </view>
  79. <u-input placeholder="点击选择签约任务" :disabled="true" @click="show = true;"></u-input>
  80. <view class="" slot="right">
  81. <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
  82. </view>
  83. </u-form-item>
  84. </view>
  85. </u-card>
  86. <u-form-item prop="protocol" :border-bottom="false">
  87. <view style="margin:0 30rpx;">
  88. <u-checkbox-group>
  89. <u-checkbox v-model="form.protocol">同意《用户协议》及《隐私政策》</u-checkbox>
  90. </u-checkbox-group>
  91. </view>
  92. </u-form-item>
  93. </u-form>
  94. <view style="margin:0 30rpx;">
  95. <u-button @click="nextStep" type="primary" @tap="$u.debounce(submit, 2000,immediate = true)" :loading="loading"
  96. :ripple="true" ripple-bg-color="#99d4ff">确认注册</u-button>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. request
  103. } from '../../common/request/request'
  104. require("promise.prototype.finally").shim()
  105. export default {
  106. data() {
  107. return {
  108. show: false,
  109. loading: false,
  110. form: {
  111. cooperation: '',
  112. protocol: false
  113. },
  114. form2: {},
  115. formData: [],
  116. dataUrl: [],
  117. agentList: [],
  118. brandList: [], //品牌
  119. nameList:""
  120. }
  121. },
  122. created() {
  123. uni.$on('formData', (data) => {
  124. this.formData = data
  125. })
  126. uni.$on('dataUrl', (data) => {
  127. this.dataUrl = data
  128. })
  129. this.getAgentArea()
  130. },
  131. methods: {
  132. getAgentArea() {
  133. request({
  134. url: '/sailun/appStoreBasicInfo/getAgentArea',
  135. method: 'post',
  136. data: {
  137. // "area": this.formData.district,
  138. // "city": this.formData.city,
  139. // "province": this.formData.province,
  140. "area": "市北区",
  141. "city": "青岛市",
  142. "province": "山东省",
  143. "spart": "10",
  144. "vkorg": "8100",
  145. "vtweg": "10"
  146. },
  147. }).then(res => {
  148. if (res.data.code == 0) {
  149. this.agentList = res.data.Data.data
  150. // 从经销商里里面抽取品牌
  151. const list = this.agentList.map((item, index) => {
  152. return item.brandList;
  153. }).join(",").split(',')
  154. //去重
  155. const list2 = [...new Set(list)]
  156. //根据复选框的数据结构重组数组
  157. this.brandList = list2.reduce((res, item) => {
  158. res.push({
  159. name: item,
  160. checked: false,
  161. disabled: false
  162. })
  163. return res;
  164. }, []);
  165. }
  166. if (res.data.code == 500) {
  167. this.$u.toast(res.data.msg);
  168. }
  169. }).catch(err => {
  170. console.log(err)
  171. }).finally(() => {
  172. })
  173. },
  174. checkboxGroupChange(e) {
  175. this.cooperations = e
  176. },
  177. getCooperation() {
  178. if (this.cooperations != null) {
  179. this.form.cooperation = this.cooperations.toString();
  180. let coopList = this.form.cooperation.split(",")
  181. let a=this.agentList.forEach((item,index, array)=>
  182. {
  183. for (let i = 0; i < array[index].brandList.length; i++) {
  184. for (let j = 0; j < coopList.length; j++) {
  185. if(coopList[j] == array[index].brandList[i]){
  186. this.nameList+=array[index].name+','
  187. }
  188. }
  189. }
  190. })
  191. this.nameList=[...new Set(this.nameList.split(',').filter(item => item))]
  192. this.show = false
  193. } else {
  194. console.log("至少选择一项")
  195. }
  196. },
  197. submit() {
  198. let data = {
  199. // "addressInfo": this.formData.addressInfo,
  200. "brandAgentLvQueryList": [{
  201. "agent_id": "string",
  202. "brand": "string",
  203. "brandCode": "string",
  204. "kunnr": "string",
  205. "lvCount": "string",
  206. "showLv": "string",
  207. "spart": "string",
  208. "vkorg": "string",
  209. "vtweg": "string"
  210. }],
  211. "city": "string",
  212. "contactName": "string",
  213. "district": "string",
  214. "jd": "string",
  215. "licenseUrl": "string",
  216. "mobileCode": "string",
  217. "province": "string",
  218. "storeImageUrl": "string",
  219. "storeName": "string",
  220. "storePhone": "string",
  221. "version": 0,
  222. "wd": "string"
  223. }
  224. console.log(data)
  225. request({
  226. url: '/sailun/appStoreBasicInfo/storeReg',
  227. method: 'post',
  228. data: data
  229. }).then(res => {
  230. console.log(res)
  231. if (res.data.code == 0) {
  232. this.loading = true
  233. setTimeout(() => {
  234. this.$u.route({
  235. url: 'pages/login/index',
  236. type: "reLaunch"
  237. })
  238. this.loading = false
  239. }, 2000)
  240. }
  241. if (res.data.code == 500) {
  242. this.$u.toast(res.data.msg);
  243. }
  244. }).catch(err => {
  245. console.log(err)
  246. }).finally(() => {
  247. })
  248. },
  249. }
  250. }
  251. </script>
  252. <style lang="scss" scoped>
  253. .content {
  254. padding: 24rpx;
  255. text-align: center;
  256. .u-checkbox[data-v-54acf820] {
  257. display: flex;
  258. justify-content: center;
  259. }
  260. }
  261. </style>