settings.vue 11 KB

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