solution.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <view
  3. class="solution"
  4. :style="{
  5. background: 'url(' + bgImg + ')',
  6. 'background-repeat': 'no-repeat',
  7. 'background-size': '100% 100%'
  8. }"
  9. @click.stop="activeSelect"
  10. >
  11. <slot name="supplier-title"></slot>
  12. <view class="solution_container">
  13. <view class="solution_item" v-for="(item, index) in solutionList" :key="item.id">
  14. <view
  15. class="solution_item_bg"
  16. :style="{
  17. background: 'url(' + item.bgImg + ')',
  18. 'background-repeat': 'no-repeat',
  19. 'background-size': '100%'
  20. }"
  21. >
  22. {{ item.title }}
  23. </view>
  24. <view class="solution_item_container">
  25. <view class="solution_text" v-for="(text, index) in item.content" :key="index">
  26. {{ text.text }}
  27. </view>
  28. <button type="default" class="solution_btn" @click="openMadel(item.title, `${index+1}`)">查看解决方案</button>
  29. </view>
  30. </view>
  31. </view>
  32. <tui-modal :show.sync="modal" custom maskClosable color="#333" :size="32">
  33. <view class="tui-modal-custom">
  34. <image class="tui-logo" src="https://static.caimei365.com/app/img/icon/supplier-h5.png" mode=""></image>
  35. <view class="tui-close" @click="close"></view>
  36. <view class="title_1">{{ solutionTitle }}</view>
  37. <view class="title_2">请完成以下信息并提交,1-3个工作日会有专人与您沟通!</view>
  38. <form>
  39. <input class="uni-input" v-model="solutionForm.userName" placeholder="请输入姓名" />
  40. <input class="uni-input" v-model="solutionForm.corporateName" placeholder="请输入公司名称" />
  41. <input class="uni-input" v-model="solutionForm.mobile" type="number" maxlength="11" placeholder="请输入您的手机号" />
  42. <multiple-select
  43. placeholder="请选择您感兴趣的问题"
  44. :value="solutionForm.list"
  45. name="name"
  46. :options="selectMultiplecolumns"
  47. @change="selectitem"
  48. :showValueClear="false"
  49. ref='select'
  50. />
  51. </form>
  52. <button
  53. :class="isTrue ? 'isTrue' : ''"
  54. height="72rpx"
  55. class="solution_btn"
  56. :size="28"
  57. shape="circle"
  58. @click="formSubmit"
  59. >
  60. 提交
  61. </button>
  62. </view>
  63. </tui-modal>
  64. </view>
  65. </template>
  66. <script>
  67. import multipleSelect from './multiple-select/multiple-select.vue'
  68. import {mapState} from 'vuex'
  69. export default {
  70. components: {
  71. multipleSelect
  72. },
  73. props: {
  74. isShareTimeline: { // 是否从朋友圈分享进入
  75. type: Boolean,
  76. default: () => false
  77. }
  78. },
  79. data() {
  80. return {
  81. bgImg: 'https://static.caimei365.com/app/img/supplier-login/solution/bg.png',
  82. // 解决方案内容
  83. solutionList: [
  84. {
  85. id: 1,
  86. title: '基础版',
  87. bgImg: 'https://static.caimei365.com/app/img/supplier-login/solution/01.png',
  88. content: [
  89. {
  90. text: '品牌商城入驻'
  91. },
  92. {
  93. text: '品牌内容宣发'
  94. },
  95. {
  96. text: '用户画像洞察'
  97. },
  98. {
  99. text: '客户旅程搭建'
  100. },
  101. {
  102. text: '客户线索跟踪'
  103. },
  104. {
  105. text: '线索转化'
  106. }
  107. ]
  108. },
  109. {
  110. id: 2,
  111. title: '高级版',
  112. bgImg: 'https://static.caimei365.com/app/img/supplier-login/solution/02.png',
  113. content: [
  114. {
  115. text: '基础版全部内容'
  116. },
  117. {
  118. text: '引流关键词策划和布局'
  119. },
  120. {
  121. text: '漏斗模型转化率评估'
  122. },
  123. {
  124. text: '数字营销内容策划'
  125. },
  126. {
  127. text: '客户线索跟踪'
  128. },
  129. {
  130. text: '线索转化'
  131. }
  132. ]
  133. },
  134. {
  135. id: 3,
  136. title: '战略版',
  137. bgImg: 'https://static.caimei365.com/app/img/supplier-login/solution/03.png',
  138. content: [
  139. {
  140. text: '高级版全部内容'
  141. },
  142. {
  143. text: '设置销售目标'
  144. },
  145. {
  146. text: '数据模型策划和执行'
  147. },
  148. {
  149. text: '品牌私域运营及正品认证通'
  150. },
  151. {
  152. text: '开放平台全域销售系统'
  153. },
  154. {
  155. text: '保证销售目标的执行'
  156. }
  157. ]
  158. }
  159. ],
  160. modal: false,
  161. btnStyle: [
  162. {
  163. text: '确定',
  164. type: '',
  165. plain: false
  166. }
  167. ],
  168. solutionTitle: '基础版', // 表单标题
  169. isTrue: false,
  170. solutionForm: {
  171. // 解决方案表单
  172. userName: '',
  173. corporateName: '',
  174. mobile: '',
  175. level: '',
  176. list: []
  177. },
  178. // 多选框配置
  179. selectMultiplecolumns: [
  180. {
  181. label: '商城入驻(商品SKU管理、订单交易管理)',
  182. value: '商城入驻(商品SKU管理、订单交易管理)'
  183. },
  184. {
  185. label: '正品认证(仪器授权认证、购机客户管理、品牌运营)',
  186. value: '正品认证(仪器授权认证、购机客户管理、品牌运营)'
  187. },
  188. {
  189. label: '销售赋能(降低管理成本,提升运营效果)',
  190. value: '销售赋能(降低管理成本,提升运营效果)'
  191. },
  192. {
  193. label: '营销获客(全渠道媒体矩阵、压缩获客成本,提高获客数/质量)',
  194. value: '营销获客(全渠道媒体矩阵、压缩获客成本,提高获客数/质量)'
  195. },
  196. {
  197. label: '私域运营(美业社群/美业直播、提高客户转化率)',
  198. value: '私域运营(美业社群/美业直播、提高客户转化率)'
  199. },
  200. {
  201. label: '客户管理(客户360“画像、客户旅程、客户行为轨迹等数据)',
  202. value: '客户管理(客户360“画像、客户旅程、客户行为轨迹等数据)'
  203. },
  204. {
  205. label: '其他',
  206. value: '其他'
  207. }
  208. ] ,//数据
  209. selectMultipleData: [], // 数据
  210. }
  211. },
  212. computed: {
  213. ...mapState(['userInfo'])
  214. },
  215. watch: {
  216. solutionForm: {
  217. handler(val) {
  218. const a = []
  219. const v = Object.values(val)
  220. v.map((i,o) => {
  221. if (!Array.isArray(i)) {
  222. if (i.length > 0) {
  223. a.push(true)
  224. } else {
  225. a.push(false)
  226. }
  227. }
  228. })
  229. if (a.findIndex(e => e === false) == -1) {
  230. this.isTrue = true
  231. } else {
  232. this.isTrue = false
  233. }
  234. },
  235. deep: true
  236. },
  237. modal(val) {
  238. this.$emit('solutionModal', val)
  239. },
  240. },
  241. methods: {
  242. openMadel($event, id) {
  243. if (this.isShareTimeline) return this.$util.msg('请前往小程序使用完整服务')
  244. this.modal = true
  245. this.solutionTitle = $event
  246. this.solutionForm.level = id
  247. },
  248. // 重置
  249. resetForm() {
  250. this.solutionForm = {
  251. // 解决方案表单
  252. userName: '',
  253. corporateName: '',
  254. mobile: '',
  255. level: '',
  256. list: []
  257. }
  258. },
  259. // change 改变form列表数据
  260. formatterList() {
  261. if (this.selectMultipleData.length > 0) {
  262. const newArr = []
  263. this.selectMultiplecolumns.forEach((i, index) => {
  264. this.selectMultipleData.forEach(o => {
  265. if(i.value == o) {
  266. newArr.push(index+1)
  267. }
  268. })
  269. })
  270. return newArr.toString()
  271. } else return ''
  272. },
  273. // 提交
  274. formSubmit() {
  275. if (this.isTrue) {
  276. this.isTrue = false
  277. const form = {
  278. userId: this.userInfo.userId ||'',
  279. level: this.solutionForm.level,
  280. userName: this.solutionForm.userName,
  281. corporateName: this.solutionForm.corporateName,
  282. mobile: this.solutionForm.mobile,
  283. content: this.formatterList()
  284. }
  285. if(!/(^1[0-9][0-9]{9}$)/.test(form.mobile)){
  286. this.$util.msg('请输入正确的手机号码')
  287. return this.isTrue = true
  288. }
  289. this.UserService.supplierSearchUpdate(form).then(res => {
  290. uni.showToast({
  291. title: '提交成功',
  292. duration: 1000,
  293. })
  294. this.modal = false
  295. this.resetForm()
  296. setTimeout(() => {
  297. this.isTrue = true
  298. }, 1000)
  299. })
  300. console.log(form)
  301. }
  302. },
  303. // 多选框确定
  304. selectitem($event) {
  305. this.selectMultipleData = $event
  306. },
  307. close() {
  308. this.modal = false
  309. this.$refs.select.active = false
  310. },
  311. // 下拉框取消选择
  312. activeSelect() {
  313. this.$refs.select.active = false
  314. },
  315. }
  316. }
  317. </script>
  318. <style scoped lang="scss">
  319. .solution {
  320. box-sizing: border-box;
  321. padding: 1rpx;
  322. margin-top: 120rpx;
  323. .solution_container {
  324. padding: 0 72rpx;
  325. box-sizing: border-box;
  326. .solution_item {
  327. width: 606rpx;
  328. height: 610rpx;
  329. box-sizing: border-box;
  330. display: flex;
  331. margin-bottom: 60rpx;
  332. .solution_item_bg {
  333. display: flex;
  334. align-items: center;
  335. writing-mode: vertical-rl;
  336. justify-content: center;
  337. width: 140rpx;
  338. font-size: 56rpx;
  339. color: #ffffff;
  340. font-weight: Bold;
  341. }
  342. .solution_item_container {
  343. width: calc(100% - 140rpx);
  344. height: 100%;
  345. position: relative;
  346. box-sizing: border-box;
  347. padding: 63rpx 70rpx;
  348. background-color: #fff;
  349. .solution_text {
  350. font-size: 28rpx;
  351. color: #666666;
  352. line-height: 64rpx;
  353. position: relative;
  354. white-space: nowrap;
  355. }
  356. .solution_text::before {
  357. content: '';
  358. border: 1px solid #b2b2b2;
  359. width: 10rpx;
  360. height: 10rpx;
  361. position: absolute;
  362. left: -30rpx;
  363. top: 25rpx;
  364. transform: rotate(45deg);
  365. }
  366. .solution_btn {
  367. position: absolute;
  368. width: 220rpx;
  369. height: 72rpx;
  370. background: #ff5b00;
  371. border-radius: 4rpx;
  372. color: #fff;
  373. font-size: 28rpx;
  374. text-align: center;
  375. line-height: 72rpx;
  376. right: 40rpx;
  377. bottom: 48rpx;
  378. }
  379. }
  380. }
  381. }
  382. }
  383. .tui-modal-custom {
  384. .tui-close {
  385. width: 22rpx;
  386. height: 22rpx;
  387. position: absolute;
  388. right: 32rpx;
  389. top: 24rpx;
  390. background: url(https://static.caimei365.com/app/img/supplier-login/modal-close.png) center;
  391. }
  392. .tui-logo {
  393. width: 580rpx;
  394. position: absolute;
  395. z-index: -1;
  396. top: 0;
  397. left: 0;
  398. width: 100%;
  399. border-radius: 16rpx;
  400. }
  401. padding-top: 40rpx;
  402. .title_1 {
  403. font-size: 36rpx;
  404. color: black;
  405. text-align: center;
  406. margin-bottom: 40rpx;
  407. font-weight: bold;
  408. }
  409. .title_2 {
  410. color: #666666;
  411. font-size: 28rpx;
  412. margin-bottom: 56rpx;
  413. text-align: center;
  414. }
  415. .uni-input {
  416. padding: 0 20rpx;
  417. margin-bottom: 23rpx;
  418. border: 1rpx solid #cccccc;
  419. border-radius: 8rpx;
  420. height: 90rpx;
  421. box-sizing: border-box;
  422. font-size: 28rpx;
  423. font-weight: 100;
  424. }
  425. .solution_btn {
  426. width: 320rpx;
  427. height: 90rpx;
  428. margin-top: 68rpx;
  429. border-radius: 8rpx;
  430. font-size: 28rpx;
  431. text-align: center;
  432. line-height: 90rpx;
  433. background: #cccccc;
  434. color: white;
  435. }
  436. .isTrue {
  437. background: #ff5b00;
  438. }
  439. }
  440. </style>