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