AI营销辅助 普强使用
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

238 righe
4.6 KiB

  1. <template>
  2. <view class="box">
  3. <view class="conmsg" v-if="allList.length!=0">
  4. <view class="conmsg-msg">
  5. <view v-for="(item,index) in allList" :key="index">
  6. <view class="">
  7. <view class="conmsg-msg-lab" style="border: none;">
  8. <view class="conmsg-msg-lab-1">
  9. {{item.name}}
  10. </view>
  11. </view>
  12. <view class="con-msg-con"
  13. :style="{borderBottom:index==allList.length-1?'none':'1px solid #E0E0E0'}">
  14. <view v-for='(item1,i) in item.children' :key='i' @click="Edittag(item,item1,index,i)"
  15. :style="{border:item1.selected==0?'1px solid #0A6EE9':'1px solid #E0E0E0'}"
  16. class="chebox">
  17. {{item1.label}}
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="submit">
  25. <view class="btn" @click="submit">
  26. 确定
  27. </view>
  28. </view>
  29. <view class="" style="height: 220rpx;"></view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. allList:[],
  37. customerId:''
  38. }
  39. },
  40. onLoad(e) {
  41. this.customerId=e.id;
  42. this.getListByType()
  43. },
  44. methods: {
  45. Edittag(item,item1,index,i){
  46. if(this.allList[index].children[i].selected==0){
  47. this.allList[index].children[i].selected=1;
  48. }else{
  49. this.allList[index].children[i].selected=0;
  50. }
  51. this.$forceUpdate()
  52. },
  53. // 字典表接口
  54. getListByType() {
  55. this.$u.get("/matchKeywords/findManualCalibration", {
  56. customerId: this.customerId,
  57. type:2
  58. })
  59. .then(res => {
  60. res.forEach(item1 => {
  61. item1.children.map(item => {
  62. if (item.isInterval == 0) {
  63. item.label = item.name + item.unit + '-' + item.endName + item
  64. .unit;
  65. } else {
  66. item.label = item.name
  67. }
  68. item.value = item.id;
  69. })
  70. })
  71. this.allList = res
  72. })
  73. },
  74. // 提交
  75. submit() {
  76. let param = {
  77. keywordIds:'',
  78. id: this.customerId,
  79. }
  80. let str = []
  81. this.allList.map(item => {
  82. item.children.map(item1 => {
  83. if (item1.selected == 0) {
  84. str.push(item1.keywordsId)
  85. }
  86. })
  87. })
  88. str = str.join(',')
  89. param.keywordIds = str
  90. this.$u.post("matchKeywords/updateManualCalibration", param).then(res => {
  91. uni.showToast({
  92. title: '操作成功',
  93. icon: 'none',
  94. success: () => {
  95. let sdd={
  96. keywordIds: this.customerId,
  97. id: this.customerId,
  98. bg:0,
  99. speaker:0
  100. }
  101. let pages = getCurrentPages() //获取当前页面栈的信息
  102. let prevPage = pages[pages.length - 2] //获取上一个页面
  103. prevPage.setData({ //把需要回传的值保存到上一个页面
  104. info: sdd
  105. });
  106. uni.navigateBack()
  107. }
  108. })
  109. })
  110. },
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .box {
  116. width: 100%;
  117. height: 100%;
  118. background: #F8F8F8;
  119. overflow: hidden;
  120. }
  121. .conmsg {
  122. background: #FFFFFF;
  123. margin-top: 20rpx;
  124. .conmsg-title {
  125. height: 92rpx;
  126. line-height: 92rpx;
  127. font-weight: bold;
  128. padding: 0 30rpx;
  129. // font-weight: 500;
  130. color: #303030;
  131. font-size: 32rpx;
  132. border-bottom: 1px solid #E0E0E0;
  133. }
  134. .conmsg-msg {
  135. padding: 0 30rpx;
  136. .conmsg-msg-lab {
  137. height: 102rpx;
  138. display: flex;
  139. font-size: 30rpx;
  140. font-weight: 400;
  141. color: #333333;
  142. border-bottom: 1px solid #E0E0E0;
  143. line-height: 102rpx;
  144. .conmsg-msg-lab-1 {
  145. display: flex;
  146. min-width: 136rpx;
  147. .star {
  148. color: #E7483C;
  149. line-height: 108rpx;
  150. }
  151. }
  152. .conmsg-msg-lab-inp {
  153. margin-top: 30rpx;
  154. margin-left: 44rpx;
  155. }
  156. .conmsg-msg-lab-img {
  157. width: 14rpx;
  158. height: 30rpx;
  159. margin-top: 6rpx;
  160. margin-left: auto;
  161. image {
  162. width: 100%;
  163. height: 100%;
  164. }
  165. }
  166. }
  167. }
  168. }
  169. .submit {
  170. position: fixed;
  171. bottom: 20rpx;
  172. left: 20rpx;
  173. height: 120rpx;
  174. background: #FFFFFF;
  175. .btn {
  176. // margin: 60rpx auto;
  177. text-align: center;
  178. width: 690rpx;
  179. height: 88rpx;
  180. background: #2671E2;
  181. border-radius: 8rpx;
  182. font-size: 32tpx;
  183. font-weight: 400;
  184. color: #FFFFFF;
  185. line-height: 88rpx;
  186. }
  187. }
  188. .con-msg-con {
  189. display: flex;
  190. flex-wrap: wrap;
  191. // justify-content: space-around;
  192. border-bottom: 1px solid #E0E0E0;
  193. padding-bottom: 16rpx;
  194. .chebox {
  195. // width: 20%;
  196. height: 60rpx;
  197. line-height: 60rpx;
  198. // margin: 10rpx 0;
  199. margin-bottom: 25rpx;
  200. margin-right: 20rpx;
  201. border: 1px solid #E0E0E0;
  202. box-sizing: border-box;
  203. padding: 0 10rpx;
  204. }
  205. }
  206. .sexchose {
  207. width: 120rpx;
  208. height: 60rpx;
  209. background: #FFFFFF;
  210. border-radius: 4rpx;
  211. border: 1px solid #E0E0E0;
  212. text-align: center;
  213. line-height: 60rpx;
  214. margin-right: 20rpx;
  215. }
  216. </style>