solution.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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. this.selectMultipleData = []
  259. this.$refs['select'].changevalue = []
  260. this.$refs['select'].realValue = []
  261. },
  262. // change 改变form列表数据
  263. formatterList() {
  264. if (this.selectMultipleData.length > 0) {
  265. const newArr = []
  266. this.selectMultiplecolumns.forEach((i, index) => {
  267. this.selectMultipleData.forEach(o => {
  268. if(i.value == o) {
  269. newArr.push(index+1)
  270. }
  271. })
  272. })
  273. return newArr.toString()
  274. } else return ''
  275. },
  276. // 提交
  277. formSubmit() {
  278. if (this.isTrue) {
  279. this.isTrue = false
  280. const form = {
  281. userId: this.userInfo.userId ||'',
  282. level: this.solutionForm.level,
  283. userName: this.solutionForm.userName,
  284. corporateName: this.solutionForm.corporateName,
  285. mobile: this.solutionForm.mobile,
  286. content: this.formatterList()
  287. }
  288. if(!/(^1[0-9][0-9]{9}$)/.test(form.mobile)){
  289. this.$util.msg('请输入正确的手机号码')
  290. return this.isTrue = true
  291. }
  292. this.UserService.supplierSearchUpdate(form).then(res => {
  293. uni.showToast({
  294. title: '提交成功',
  295. duration: 1000,
  296. })
  297. this.modal = false
  298. this.resetForm()
  299. setTimeout(() => {
  300. this.isTrue = true
  301. }, 1000)
  302. })
  303. console.log(form)
  304. }
  305. },
  306. // 多选框确定
  307. selectitem($event) {
  308. this.selectMultipleData = $event
  309. },
  310. close() {
  311. this.modal = false
  312. this.$refs.select.active = false
  313. },
  314. // 下拉框取消选择
  315. activeSelect() {
  316. this.$refs.select.active = false
  317. },
  318. }
  319. }
  320. </script>
  321. <style scoped lang="scss">
  322. .solution {
  323. box-sizing: border-box;
  324. padding: 1rpx;
  325. margin-top: 120rpx;
  326. .solution_container {
  327. padding: 0 72rpx;
  328. box-sizing: border-box;
  329. .solution_item {
  330. width: 606rpx;
  331. height: 610rpx;
  332. box-sizing: border-box;
  333. display: flex;
  334. margin-bottom: 60rpx;
  335. .solution_item_bg {
  336. display: flex;
  337. align-items: center;
  338. writing-mode: vertical-rl;
  339. justify-content: center;
  340. width: 140rpx;
  341. font-size: 56rpx;
  342. color: #ffffff;
  343. font-weight: Bold;
  344. }
  345. .solution_item_container {
  346. width: calc(100% - 140rpx);
  347. height: 100%;
  348. position: relative;
  349. box-sizing: border-box;
  350. padding: 63rpx 70rpx;
  351. background-color: #fff;
  352. .solution_text {
  353. font-size: 28rpx;
  354. color: #666666;
  355. line-height: 64rpx;
  356. position: relative;
  357. white-space: nowrap;
  358. }
  359. .solution_text::before {
  360. content: '';
  361. border: 1px solid #b2b2b2;
  362. width: 10rpx;
  363. height: 10rpx;
  364. position: absolute;
  365. left: -30rpx;
  366. top: 25rpx;
  367. transform: rotate(45deg);
  368. }
  369. .solution_btn {
  370. position: absolute;
  371. width: 220rpx;
  372. height: 72rpx;
  373. background: #ff5b00;
  374. border-radius: 4rpx;
  375. color: #fff;
  376. font-size: 28rpx;
  377. text-align: center;
  378. line-height: 72rpx;
  379. right: 40rpx;
  380. bottom: 48rpx;
  381. }
  382. }
  383. }
  384. }
  385. }
  386. .tui-modal-custom {
  387. .tui-close {
  388. width: 22rpx;
  389. height: 22rpx;
  390. position: absolute;
  391. right: 32rpx;
  392. top: 24rpx;
  393. background: url(https://static.caimei365.com/app/img/supplier-login/modal-close.png) center;
  394. }
  395. .tui-logo {
  396. width: 580rpx;
  397. position: absolute;
  398. z-index: -1;
  399. top: 0;
  400. left: 0;
  401. width: 100%;
  402. border-radius: 16rpx;
  403. }
  404. padding-top: 40rpx;
  405. .title_1 {
  406. font-size: 36rpx;
  407. color: black;
  408. text-align: center;
  409. margin-bottom: 40rpx;
  410. font-weight: bold;
  411. }
  412. .title_2 {
  413. color: #666666;
  414. font-size: 28rpx;
  415. margin-bottom: 56rpx;
  416. text-align: center;
  417. }
  418. .uni-input {
  419. padding: 0 20rpx;
  420. margin-bottom: 23rpx;
  421. border: 1rpx solid #cccccc;
  422. border-radius: 8rpx;
  423. height: 90rpx;
  424. box-sizing: border-box;
  425. font-size: 28rpx;
  426. font-weight: 100;
  427. }
  428. .solution_btn {
  429. width: 320rpx;
  430. height: 90rpx;
  431. margin-top: 68rpx;
  432. border-radius: 8rpx;
  433. font-size: 28rpx;
  434. text-align: center;
  435. line-height: 90rpx;
  436. background: #cccccc;
  437. color: white;
  438. }
  439. .isTrue {
  440. background: #ff5b00;
  441. }
  442. }
  443. </style>