detail.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view>
  3. <view class="head">
  4. <view class="title u-line-1">{{ detail.storename || '' }}</view>
  5. <view class="content">
  6. <view class="left">
  7. <view class="tag-box">
  8. <view class="storetype">
  9. {{ detail.storetype }}
  10. </view>
  11. <view class="markettype">
  12. {{ detail.markettype }}
  13. </view>
  14. </view>
  15. <view class="row">
  16. <text class="iconfont icon-renyuan-hui" />
  17. <text>
  18. {{ detail.name }}
  19. </text>
  20. <text style="margin-left: 5px;">
  21. {{ detail.phonenumber }}
  22. </text>
  23. </view>
  24. <view class="row">
  25. <text class="iconfont icon-dizhi-hui1" />
  26. {{ getCity(detail) }}
  27. </view>
  28. <view class="row">
  29. 状态:<text style="color: #333333;">{{ detail.status }}</text>
  30. </view>
  31. </view>
  32. <view class="right">
  33. <u--image :src="detail.cover" :width="tovw(100)" :height="tovw(100)" radius="5">
  34. <template v-slot:loading>
  35. <u-loading-icon color="red"></u-loading-icon>
  36. </template>
  37. </u--image>
  38. </view>
  39. </view>
  40. </view>
  41. <u-tabs :scrollable="false" lineColor="#C30D23" :activeStyle="{ color: '#C30D23', fontWeight: 'bold' }" :list="tabs"
  42. @click="changeCurrent" :current="current" />
  43. <view v-show="current == 0">
  44. <displayCell :showList="showList" :detail="detail" />
  45. </view>
  46. <block v-if="detail.status != '审核'">
  47. <view style="height: 75px;" />
  48. <view class="footer">
  49. <view class="insert" :class="detail.status == '新建' ? '' : 'forbidden'"
  50. @click="detail.status == '新建' ? toEdit() : ''">
  51. 编辑门店信息
  52. </view>
  53. <view class="invite" @click="detail.status == '新建' ? submit() : revocation()">
  54. {{ detail.status == '新建' ? '提交门店信息' : '撤回' }}
  55. </view>
  56. </view>
  57. </block>
  58. <view v-else style="height: 30px;" />
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. current: 0,
  66. sa_storeid: 0,
  67. detail: {},
  68. tabs: [{ name: "门店详情" }, { name: "门店人员" }],
  69. showList: []
  70. }
  71. },
  72. onLoad(options) {
  73. console.log(options)
  74. this.sa_storeid = options.id;
  75. this.getDetail();
  76. uni.setNavigationBarTitle({
  77. title: '门店信息'
  78. });
  79. },
  80. onUnload() {
  81. delete this.$Http.uploadStoreDetail;
  82. },
  83. methods: {
  84. getDetail() {
  85. this.$Http.basic({
  86. "id": "20240410095402",
  87. "content": {
  88. "sa_storeid": this.sa_storeid
  89. }
  90. }).then(res => {
  91. console.log("店铺详情", res)
  92. if (this.cutoff(res.msg)) return;
  93. res.data.cover = res.data.attinfos.length ? this.getSpecifiedImage(res.data.attinfos[0], 'compressed') || uni.getStorageSync("site").logo : uni.getStorageSync("site").logo
  94. this.detail = res.data;
  95. this.showList = [{
  96. label: "门店名称",
  97. key: "storename"
  98. }, {
  99. label: "面积(m²)",
  100. key: "area"
  101. }, {
  102. label: "负责人",
  103. key: "name"
  104. }, {
  105. label: "负责人电话",
  106. key: "phonenumber",
  107. funName: "callPhone"
  108. }, {
  109. label: "负责人账号",
  110. key: "accountno"
  111. }, {
  112. label: "门店售前电话",
  113. key: "sale_phonenmber",
  114. funName: "callPhone"
  115. }, {
  116. label: "门店售后电话",
  117. key: "service_phonenmber",
  118. funName: "callPhone"
  119. }, {
  120. label: "门店类型",
  121. key: 'storetype'
  122. }, {
  123. label: "卖场类型",
  124. key: "markettype"
  125. }, {
  126. label: "门店地址",
  127. value: this.getCity(res.data)
  128. }, {
  129. label: "所属经销商",
  130. key: "enterprisename"
  131. },]
  132. })
  133. },
  134. toEdit() {
  135. this.$Http.uploadStoreDetail = this.getDetail.bind(this);
  136. uni.navigateTo({
  137. url: "/store/insert/store?title=编辑门店信息&data=" + JSON.stringify(this.detail)
  138. })
  139. },
  140. submit() {
  141. let that = this;
  142. uni.showModal({
  143. title: '提交门店信息',
  144. content: '是否确定提交门店信息?',
  145. success: function ({ confirm }) {
  146. if (confirm) that.$Http.basic({
  147. "id": "20240410110302",
  148. "content": {
  149. "sa_storeid": that.detail.sa_storeid
  150. }
  151. }).then(res => {
  152. console.log('提交门店信息', res)
  153. if (that.cutoff(res.msg, '提交成功!')) return;
  154. that.$Http.uploadStoreList && that.$Http.uploadStoreList();
  155. that.getDetail();
  156. })
  157. }
  158. });
  159. },
  160. revocation() {
  161. let that = this;
  162. uni.showModal({
  163. title: '提交门店信息',
  164. content: '是否确定撤回提交门店信息?',
  165. success: function ({ confirm }) {
  166. if (confirm) that.$Http.basic({
  167. "id": "20240410110802",
  168. "content": {
  169. "sa_storeid": that.detail.sa_storeid
  170. }
  171. }).then(res => {
  172. console.log('撤回提交门店信息', res)
  173. if (that.cutoff(res.msg, '撤回提交成功!')) return;
  174. that.$Http.uploadStoreList && that.$Http.uploadStoreList();
  175. that.getDetail();
  176. })
  177. }
  178. });
  179. },
  180. changeCurrent({ index }) {
  181. this.current = index;
  182. }
  183. },
  184. }
  185. </script>
  186. <style lang="scss" scoped>
  187. .head {
  188. width: 100vw;
  189. background: #FFFFFF;
  190. border-radius: 8px;
  191. padding: 10px;
  192. box-sizing: border-box;
  193. margin-bottom: 10px;
  194. .title {
  195. line-height: 24px;
  196. font-family: Source Han Sans SC, Source Han Sans SC;
  197. font-weight: bold;
  198. font-size: 16px;
  199. color: #333333;
  200. }
  201. .content {
  202. position: relative;
  203. .left {
  204. width: 220px;
  205. .tag-box {
  206. display: flex;
  207. .storetype,
  208. .markettype {
  209. font-family: Source Han Sans SC, Source Han Sans SC;
  210. font-size: 12px;
  211. color: #FFFFFF;
  212. height: 24px;
  213. line-height: 24px;
  214. padding: 0 4px;
  215. border-radius: 2px;
  216. margin-top: 5px;
  217. }
  218. .storetype {
  219. background: #095DE0;
  220. }
  221. .markettype {
  222. background: #FC9228;
  223. margin-left: 5px;
  224. }
  225. }
  226. .row {
  227. line-height: 17px;
  228. font-family: Source Han Sans SC, Source Han Sans SC;
  229. font-size: 12px;
  230. color: #888888;
  231. margin-top: 5px;
  232. .iconfont {
  233. margin-right: 5px;
  234. font-size: 12px;
  235. }
  236. }
  237. }
  238. .right {
  239. position: absolute;
  240. right: 0;
  241. bottom: 0;
  242. }
  243. }
  244. }
  245. .footer {
  246. position: fixed;
  247. bottom: 0;
  248. display: flex;
  249. justify-content: space-between;
  250. width: 100vw;
  251. height: 65px;
  252. background: #FFFFFF;
  253. box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
  254. padding: 5px 10px;
  255. box-sizing: border-box;
  256. .insert {
  257. display: flex;
  258. align-items: center;
  259. justify-content: center;
  260. width: 168px;
  261. height: 45px;
  262. background: #FFFFFF;
  263. border-radius: 5px;
  264. border: 1px solid #999999;
  265. font-family: PingFang SC, PingFang SC;
  266. font-size: 16px;
  267. color: #666666;
  268. box-sizing: border-box;
  269. }
  270. .invite {
  271. display: flex;
  272. align-items: center;
  273. justify-content: center;
  274. width: 177px;
  275. height: 45px;
  276. background: #C30D23;
  277. border-radius: 5px;
  278. font-family: PingFang SC, PingFang SC;
  279. font-weight: 500;
  280. font-size: 16px;
  281. color: #FFFFFF;
  282. }
  283. .forbidden {
  284. opacity: .6;
  285. }
  286. }
  287. </style>