settings.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template>
  2. <view>
  3. <!-- <cu-custom bgColor="bg-fff" :isBack="true">
  4. <block slot="content">店铺设置</block>
  5. </cu-custom> -->
  6. <view class="top"></view>
  7. <view class="head">
  8. <view class="handle">
  9. <view class="head_left">
  10. <span class="cuIcon-back" @click="back"></span>
  11. </view>
  12. <span class="center">店铺设置</span>
  13. <view class="head_right">
  14. </view>
  15. </view>
  16. </view>
  17. <view class="bg-fff" v-for="ele in ulList" :key="ele.name">
  18. <view class=" cu-form-group" :style="ele.name == '基本信息' ? 'margin-top:0' : ''">
  19. <view class="content ">
  20. <text class="text-bold">{{ ele.name }}</text>
  21. <i class="text-bg "></i>
  22. </view>
  23. </view>
  24. <view v-for="val in ele.liList" :key="val.label">
  25. <view class="cu-form-group justify-between">
  26. <view class="title" v-if="val.status" style="display: flex;align-items: center;">
  27. <text>{{ val.label }} </text>
  28. <text v-if="val.status=='headPhotoStatus'" style="font-size: 20rpx;color: #7e7e7e;margin: 0 10rpx;">门头照</text>
  29. <text v-if="indexOption[val.status] == 0" class="bg-orange">待审核</text>
  30. <text v-if="indexOption[val.status] == 1" class="bg-grey">审核通过</text>
  31. <text v-if="indexOption[val.status] == 2" class="bg-pink">审核驳回</text>
  32. </view>
  33. <view>
  34. <text style="color: #C7C6CA ;" @click="jump(val)"
  35. v-if="val.status == 'advertising' || val.status == 'headPhoto'">去上传</text>
  36. <text style="color: #C7C6CA ;" @click="jump(val)" v-else>去配置</text>
  37. <text class='cuIcon-right' style="color: #C7C6CA ;"></text>
  38. </view>
  39. </view>
  40. <view v-if="val.label == '服务设施'" style="padding-left: 42upx;">
  41. <text v-for="(tag, index) in selectTags" :key="index" class="tag-type tag-type-po">
  42. {{ tag }}
  43. </text>
  44. </view>
  45. <view v-if="val.label == '其他'" style="padding-left: 42upx;" @click="jumpOther">
  46. </view>
  47. </view>
  48. </view>
  49. <view class="other-tag">
  50. <view class="title" v-for="(item,index) in otherTags" :key="index">
  51. <span>{{item.className}}</span>
  52. <view class="scene" v-for="(row,index) in item.localMerchantOtherVoList" :key="index">
  53. <span>{{row.attribute}}</span>
  54. <view class="item" >
  55. <span v-for="(sun,index) in row.attributeValue.split(',')" :key="index">{{sun}}</span>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <uni-popup ref="popup" type="bottom">
  61. <view class="popup-box">
  62. <view class="popup-title">
  63. <text>选择配套设施</text>
  64. <image src="/static/store/detele.png" mode="aspectFit" @click=" $refs.popup.close()"></image>
  65. </view>
  66. <view style="padding-bottom:20upx;border-bottom: 1px solid #EEEEEE;">
  67. <text v-for="(tag, index) in tags" :key="index" class="tag-type"
  68. :class="{ 'selected-background': isSelected(tag) }" :style="tag == '空调' ? 'margin-right:0' : ''"
  69. @click="toggleSelection(tag)">
  70. {{ tag }}
  71. </text>
  72. </view>
  73. <view class=" flex sub-bottom justify-between">
  74. <button class="cu-btn round line-gray shadow" @click=" $refs.popup.close()">取消</button>
  75. <button style="width:77%" class="cu-btn bg-blue round shadow" @click="submit">确定</button>
  76. </view>
  77. </view>
  78. </uni-popup>
  79. </view>
  80. </template>
  81. <script>
  82. import {
  83. USER_INFO
  84. } from "@/common/util/constants"
  85. export default {
  86. data() {
  87. return {
  88. selectTags: [],
  89. tags: ['停车位', '休息室', 'WIFI', '空调', '茶点', '洗手间'], // 你的标签数组
  90. selectedIndices: [], // 用于存储被选中的标签索引
  91. ulList: [{
  92. name: '基本信息',
  93. liList: [{
  94. label: '店铺信息',
  95. status: 'status'
  96. }, {
  97. label: '品牌信息',
  98. status: 'logoStatus'
  99. }, {
  100. label: '经营信息',
  101. status: ' '
  102. },
  103. {
  104. label: '广告素材',
  105. // status: 'advertising'
  106. status: 'videoStatus'
  107. },
  108. {
  109. label: '商户照片',
  110. status: 'headPhotoStatus'
  111. },
  112. ],
  113. },
  114. {
  115. name: '其他信息',
  116. liList: [{
  117. label: '经营资质',
  118. status: 'specialStatus'
  119. }, {
  120. label: '服务设施',
  121. status: ' '
  122. }, {
  123. label: '其他',
  124. status: ' '
  125. },],
  126. }
  127. ],
  128. merchantId: '',
  129. indexOption: {},
  130. otherTags:[]
  131. }
  132. },
  133. async onShow() {
  134. this.merchantId = uni.getStorageSync(USER_INFO).merchantId;
  135. let res = await this.$http.get("/merchant/localMerchantInfo/queryAppInfoById?id=" + this.merchantId)
  136. if (res.data.success) {
  137. this.selectTags = res.data.result.content ? res.data.result.content.split(',').filter(id => id !== '') : []
  138. this.indexOption = res.data.result
  139. uni.setStorageSync('address', {lng:res.data.result.longitude,lat:res.data.result.latitude,address:res.data.result.address});
  140. uni.setStorageSync('currentAddress', {name:res.data.result.address});
  141. } else {
  142. this.$tip.toast(res.data.message);
  143. }
  144. this.getOther()
  145. },
  146. methods: {
  147. back(){
  148. uni.switchTab({
  149. url:'/pages/index/index'
  150. })
  151. },
  152. getOther(){
  153. this.$http.get('/localOther/localMerchantOther/queryById?id='+this.merchantId).then(res => {
  154. console.log(res)
  155. this.otherTags = res.data.result
  156. })
  157. },
  158. submit() {
  159. let code = !!this.indexOption.content ? '/merchant/localMerchantService/edit' :
  160. '/merchant/localMerchantService/add'
  161. this.$http.post(code, {
  162. merchantId: this.merchantId,
  163. content: this.selectedIndices.join(',')
  164. }).then(res => {
  165. if (res.data.success) {
  166. this.$tip.success(res.data.result || '成功')
  167. uni.redirectTo({
  168. url: '/pages/store/settings'
  169. });
  170. } else {
  171. this.$tip.error(res.data.message);
  172. }
  173. })
  174. },
  175. // 检查一个标签是否被选中
  176. isSelected(tag) {
  177. return this.selectedIndices.includes(tag);
  178. },
  179. // 切换标签的选中状态
  180. toggleSelection(tag) {
  181. const indexIndex = this.selectedIndices.indexOf(tag);
  182. if (indexIndex > -1) {
  183. // 如果标签已经被选中,则移除它
  184. this.selectedIndices.splice(indexIndex, 1);
  185. } else {
  186. // 如果标签没有被选中,则添加它
  187. this.selectedIndices.push(tag);
  188. }
  189. },
  190. jump(item) {
  191. const queryString = encodeURIComponent(JSON.stringify(this.indexOption))
  192. if (item.label == '店铺信息') {
  193. uni.navigateTo({
  194. url: `/pages/login/settled?params=${queryString}`
  195. });
  196. }
  197. if (item.label == '品牌信息') {
  198. uni.navigateTo({
  199. url: `/pages/store/brandMessage?params=${queryString}`
  200. });
  201. }
  202. if (item.label == '经营信息') {
  203. uni.navigateTo({
  204. url: `/pages/store/businessInfor?params=${queryString}`
  205. });
  206. }
  207. if (item.label == '经营资质') {
  208. uni.navigateTo({
  209. url: `/pages/store/businessQua?params=${queryString}`
  210. });
  211. }
  212. if (item.label == '服务设施') {
  213. this.$refs.popup.open()
  214. this.selectedIndices = [...this.selectTags]
  215. }
  216. if (item.label == '广告素材') {
  217. uni.navigateTo({
  218. url: `/pages/store/advertising?params=${queryString}`
  219. });
  220. }
  221. if (item.label == '商户照片') {
  222. uni.navigateTo({
  223. url: `/pages/store/headPhoto?params=${queryString}`
  224. });
  225. }
  226. if (item.label == '其他') {
  227. uni.navigateTo({
  228. url: `/pages/store/otherSet?params=${queryString}`
  229. });
  230. }
  231. }
  232. }
  233. }
  234. </script>
  235. <style scoped lang="scss">
  236. page {
  237. background: #F8F8FA;
  238. }
  239. .top {
  240. width: 100%;
  241. height: var(--status-bar-height);
  242. background: linear-gradient(87deg, #FFFFFF 0%, #A3CDFF 100%), linear-gradient(360deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
  243. }
  244. .head {
  245. width: 100%;
  246. background: #ffffff;
  247. .handle {
  248. height: 112rpx;
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: center;
  252. padding: 0px 24rpx;
  253. position: relative;
  254. .head_left {
  255. font-size: 40rpx;
  256. }
  257. .center {
  258. position: absolute;
  259. left: 50%;
  260. top: 50%;
  261. transform: translate(-50%, -50%);
  262. font-size: 30rpx;
  263. font-weight: 600;
  264. }
  265. .head_right {
  266. display: flex;
  267. justify-content: space-between;
  268. align-items: center;
  269. span {
  270. width: 40rpx;
  271. height: 40rpx;
  272. display: flex;
  273. font-size: 28rpx;
  274. justify-content: center;
  275. align-items: center;
  276. }
  277. }
  278. }
  279. }
  280. .cu-form-group {
  281. margin: 18upx 42upx;
  282. }
  283. /* .cu-form-group+.cu-form-group{
  284. border:none;
  285. border-top: 1upx solid #eee;
  286. } */
  287. .cu-form-group:not(.bg-fff :has(+ .cu-form-group)) {
  288. border: none
  289. }
  290. .bg-orange {
  291. background: #FBF9E4;
  292. color: #F6863E;
  293. font-size: 24upx;
  294. padding: 6upx 10upx;
  295. margin-left: 12upx;
  296. }
  297. .bg-grey {
  298. background: #F3F3F3;
  299. color: #7E7E7E;
  300. font-size: 24upx;
  301. padding: 6upx 10upx;
  302. margin-left: 12upx;
  303. }
  304. .bg-pink {
  305. background: #FBE5E4;
  306. color: #F34F4F;
  307. font-size: 24upx;
  308. padding: 6upx 10upx;
  309. margin-left: 12upx;
  310. }
  311. .popup-box {
  312. background: #FFFFFF;
  313. padding: 0 27upx;
  314. border-radius: 20px 20px 0px 0px;
  315. .popup-title {
  316. padding: 22upx 0;
  317. position: relative;
  318. text-align: center;
  319. font-weight: 500;
  320. font-size: 34upx;
  321. color: #333333;
  322. border-bottom: 1px solid #EEEEEE;
  323. image {
  324. position: absolute;
  325. right: 0;
  326. width: 42upx;
  327. height: 42upx;
  328. }
  329. }
  330. }
  331. .tag-type {
  332. display: inline-block;
  333. font-size: 26upx;
  334. width: 150upx;
  335. height: 54upx;
  336. color: #333333;
  337. margin: 18upx 33upx 0 0;
  338. border-radius: 4px 4px 4px 4px;
  339. border: 1px solid #C2C2C2;
  340. text-align: center;
  341. line-height: 54upx;
  342. }
  343. .tag-type-po {
  344. background: rgba(68, 154, 255, 0.1);
  345. border: 1px solid #449AFF;
  346. color: #2983EC;
  347. margin: 0 24upx 18upx 0;
  348. }
  349. .selected-background {
  350. color: #2983EC;
  351. position: relative;
  352. background: rgba(68, 154, 255, 0.1);
  353. border: 1px solid #449AFF;
  354. }
  355. .selected-background ::after {
  356. content: '';
  357. position: absolute;
  358. top: -1px;
  359. right: -1px;
  360. width: 22upx;
  361. height: 22upx;
  362. background-image: url('/static/store/xuanzhong.png');
  363. background-size: cover;
  364. background-repeat: no-repeat;
  365. border-radius: 0 5px 0 0;
  366. }
  367. .sub-bottom {
  368. width: 100%;
  369. background: #FFFFFF;
  370. padding: 27upx 0;
  371. }
  372. .title {
  373. text {
  374. height: 34rpx;
  375. display: flex;
  376. align-items: center;
  377. justify-content: center;
  378. }
  379. }
  380. .other-tag{
  381. width: 95%;
  382. margin: 0 auto;
  383. padding: 24rpx 32rpx;
  384. background-color: #fff;
  385. .title{
  386. span{
  387. display: inline-block;
  388. font-weight: 500;
  389. font-size: 26rpx;
  390. margin-bottom: 20rpx;
  391. }
  392. }
  393. .scene{
  394. span{
  395. display: inline-block;
  396. font-size: 24rpx;
  397. color: #666666;
  398. margin-bottom: 0rpx;
  399. }
  400. }
  401. .item{
  402. width: 100%;
  403. display: flex;
  404. align-items: center;
  405. span{
  406. display: inline-block;
  407. width: 120rpx;
  408. height: 49rpx;
  409. background: rgba(68,154,255,0.1);
  410. border-radius: 4rpx ;
  411. font-size: 22rpx;
  412. color: #2983EC;
  413. margin: 10rpx;
  414. display: flex;
  415. align-items: center;
  416. justify-content: center;
  417. }
  418. }
  419. }
  420. </style>