register_3.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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="brandShow = 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="brandShow">
  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" @click="brandShow=false">
  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" style="display: flex;justify-content: center">
  37. <u-checkbox v-model="item.checked" v-for="(item, index) in agentList" :key="index" :name="item.brand" shape="circle">
  38. <view class="u-flex u-row-left" style="width: 150rpx;">
  39. {{item.brand}}
  40. </view>
  41. </u-checkbox>
  42. </u-checkbox-group>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </u-popup>
  47. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false">
  48. <view slot="head">
  49. <view class="u-flex">
  50. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  51. 已选合作品牌
  52. </view>
  53. </view>
  54. <view slot="body">
  55. <view class="u-flex u-flex-wrap u-row-around">
  56. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  57. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  58. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  59. <u-image width="40%" height="100rpx" src="../../static/sailun/anyu.png" style="margin:10rpx;"></u-image>
  60. </view>
  61. </view>
  62. </u-card>
  63. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
  64. v-for="(item, index) in checkedAgentlist" :key="index">
  65. <view slot="head">
  66. <view class="u-flex">
  67. <view style="width: 8rpx;height: 34rpx;background: #0292FD;margin-right:20rpx;"></view>
  68. {{item.brand}}合作品牌签约任务
  69. </view>
  70. </view>
  71. <view slot="body">
  72. <u-form-item>
  73. <view style="margin-right: 10rpx;">
  74. <u-icon name="account" size="36"></u-icon>
  75. </view>
  76. <view class="">
  77. {{item.name}}
  78. </view>
  79. </u-form-item>
  80. <u-form-item prop="tasklist">
  81. <view style="margin-right: 10rpx;">
  82. <u-icon name="order" size="36"></u-icon>
  83. </view>
  84. <u-radio-group v-model="item.taskNum" @change="radioGroupChange">
  85. <u-radio v-for="(i, index) in item.tasknameList" :key="index" :name="i.task" :disabled="i.taskdisabled">
  86. {{i.task}}
  87. </u-radio>
  88. </u-radio-group>
  89. <!-- <u-input placeholder="点击选择签约任务" :disabled="true" @click="item.taskShow = true" v-model="form.tasklist"></u-input>
  90. <view class="" slot="right">
  91. <u-icon name="arrow-right" color="#666666" size="36"></u-icon>
  92. </view> -->
  93. </u-form-item>
  94. <!-- <u-select v-model="item.taskShow" :list="item.taskList" value-name="numTask" label-name="signLv" @confirm="getTaskconfirm"></u-select> -->
  95. </view>
  96. </u-card>
  97. <u-form-item prop="protocol" :border-bottom="false">
  98. <view style="margin:0 30rpx;">
  99. <u-checkbox-group>
  100. <u-checkbox v-model="form.protocol">同意《用户协议》及《隐私政策》</u-checkbox>
  101. </u-checkbox-group>
  102. </view>
  103. </u-form-item>
  104. </u-form>
  105. <view style="margin:0 30rpx;">
  106. <u-button @click="nextStep" type="primary" @tap="$u.debounce(submit, 2000,immediate = true)" :loading="loading"
  107. :ripple="true" ripple-bg-color="#99d4ff">确认注册</u-button>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. import {
  113. request
  114. } from '../../common/request/request'
  115. require("promise.prototype.finally").shim()
  116. export default {
  117. data() {
  118. return {
  119. brandShow: false,
  120. loading: false,
  121. form: {
  122. cooperation: '',
  123. protocol: false,
  124. },
  125. form2: {},
  126. formData: [],
  127. dataUrl: [],
  128. agentList: [], //经销商信息
  129. checkedAgentlist: [],
  130. taskList: [],
  131. tasknameList: []
  132. }
  133. },
  134. created() {
  135. uni.$on('formData', (data) => {
  136. this.formData = data
  137. })
  138. uni.$on('dataUrl', (data) => {
  139. this.dataUrl = data
  140. })
  141. this.getAgentArea()
  142. this.getTasknum()
  143. },
  144. methods: {
  145. getAgentArea() {
  146. request({
  147. url: '/sailun/appStoreBasicInfo/getAgentArea',
  148. method: 'post',
  149. data: {
  150. // "area": this.formData.district,
  151. // "city": this.formData.city,
  152. // "province": this.formData.province,
  153. "area": "市北区",
  154. "city": "青岛市",
  155. "province": "山东省",
  156. "spart": "10",
  157. "vkorg": "8100",
  158. "vtweg": "10"
  159. },
  160. }).then(res => {
  161. if (res.data.code == 0) {
  162. this.agentList = res.data.Data.data
  163. console.log(this.agentList)
  164. this.agentList = this.agentList.reduce((res, item, index, array) => {
  165. for (let i = 0; i < array[index].brandList.length; i++) {
  166. res.push({
  167. brand: array[index].brandList[i],
  168. brandCode: array[index].brandList[i],
  169. name: item.name,
  170. kunnr: item.kunnr,
  171. agent_id: item.kunnr,
  172. tasknameList:this.tasknameList,
  173. taskNum:"",
  174. checked: false,
  175. disabled: false,
  176. })
  177. }
  178. return res;
  179. }, []);
  180. console.log(this.agentList)
  181. }
  182. if (res.data.code == 500) {
  183. this.$u.toast(res.data.msg);
  184. }
  185. }).catch(err => {
  186. console.log(err)
  187. }).finally(() => {
  188. })
  189. },
  190. getTasknum() {
  191. request({
  192. url: '/sailun/appStoreBasicInfo/enum',
  193. method: 'get',
  194. data: {},
  195. }).then(res => {
  196. if (res.data.code == 0) {
  197. this.taskList = res.data.data
  198. this.tasknameList = this.taskList.reduce((res, item) => {
  199. res.push({
  200. task: item.signLv,
  201. taskdisabled: false,
  202. })
  203. return res;
  204. }, []);
  205. console.log(this.taskList)
  206. }
  207. if (res.data.code == 500) {
  208. this.$u.toast(res.data.msg);
  209. }
  210. }).catch(err => {
  211. console.log(err)
  212. }).finally(() => {
  213. })
  214. },
  215. checkboxGroupChange(e) {
  216. this.cooperations = e
  217. },
  218. radioGroupChange(e) {
  219. console.log(e);
  220. },
  221. getCooperation() {
  222. if (this.cooperations != null) {
  223. this.form.cooperation = this.cooperations.toString();
  224. this.checkedAgentlist = this.agentList.filter(item => this.cooperations.indexOf(item.brand) > -1)
  225. this.brandShow = false
  226. } else {
  227. console.log("至少选择一项")
  228. }
  229. },
  230. getTaskconfirm(e) {
  231. console.log(e)
  232. this.form.tasklist = e[0].label;
  233. console.log(this.form.tasklist)
  234. },
  235. submit() {
  236. // console.log(this.)
  237. // let data = {
  238. // "brandAgentLvQueryList": [{
  239. // "agent_id": "string",
  240. // "brand": "string",
  241. // "brandCode": "string",
  242. // "kunnr": "string",
  243. // "lvCount": "string",
  244. // "showLv": "string",
  245. // "spart": "string",
  246. // "vkorg": "string",
  247. // "vtweg": "string"
  248. // }],
  249. // "city": "string",
  250. // "contactName": "string",
  251. // "district": "string",
  252. // "jd": "string",
  253. // "licenseUrl": "string",
  254. // "mobileCode": "string",
  255. // "province": "string",
  256. // "storeImageUrl": "string",
  257. // "storeName": "string",
  258. // "storePhone": "string",
  259. // "version": 0,
  260. // "wd": "string"
  261. // }
  262. // console.log(data)
  263. // request({
  264. // url: '/sailun/appStoreBasicInfo/storeReg',
  265. // method: 'post',
  266. // data: data
  267. // }).then(res => {
  268. // console.log(res)
  269. // if (res.data.code == 0) {
  270. // this.loading = true
  271. // setTimeout(() => {
  272. // this.$u.route({
  273. // url: 'pages/login/index',
  274. // type: "reLaunch"
  275. // })
  276. // this.loading = false
  277. // }, 2000)
  278. // }
  279. // if (res.data.code == 500) {
  280. // this.$u.toast(res.data.msg);
  281. // }
  282. // }).catch(err => {
  283. // console.log(err)
  284. // }).finally(() => {
  285. // })
  286. },
  287. }
  288. }
  289. </script>
  290. <style lang="scss" scoped>
  291. .content {
  292. padding: 24rpx;
  293. text-align: center;
  294. .u-checkbox[data-v-54acf820] {
  295. display: flex;
  296. justify-content: center;
  297. }
  298. }
  299. </style>