index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. <template>
  2. <base-page>
  3. <view class="common-wrap common-form">
  4. <view class="store-information">
  5. <view class="store-status">门店信息</view>
  6. <view class="store-types">
  7. <view class="info-left">
  8. <view class="type type1">
  9. <view>门店名称:</view>
  10. <view>{{ storeData.store_name }}</view>
  11. </view>
  12. <view class="type type1">
  13. <view>门店电话:</view>
  14. <view class="message">{{ storeData.telphone }}</view>
  15. </view>
  16. <view class="type type1">
  17. <view>门店类型:</view>
  18. <view class="message">{{ storeData.store_type == 'directsale' ? '直营店' : '加盟店' }}</view>
  19. </view>
  20. <view class="type type1">
  21. <view>门店地址:</view>
  22. <view class="message">{{ storeData.full_address }}{{ storeData.address }}</view>
  23. </view>
  24. </view>
  25. <view class="info-img"><image :src="$util.img(storeData.store_image)" @error="$util.img(defaultImg.store)" mode="aspectFit"></image></view>
  26. <view class="btn" @click="$util.redirectTo('/pages/store/config')">设置</view>
  27. </view>
  28. </view>
  29. <view class="store-information">
  30. <view class="store-status">运营信息</view>
  31. <view class="store-types">
  32. <view class="info-left">
  33. <view class="type type1">
  34. <view>营业状态:</view>
  35. <view class="message">{{ storeData.status == 1 ? '营业中' : '已停业' }}</view>
  36. </view>
  37. <view class="type type1">
  38. <view>营业时间:</view>
  39. <view class="message">{{ storeData.open_date }}</view>
  40. </view>
  41. <view class="type type1">
  42. <view>物流配送:</view>
  43. <view class="message">{{ storeData.is_express ? '开启' : '关闭' }}</view>
  44. </view>
  45. <view class="type type1">
  46. <view>同城配送:</view>
  47. <view>{{ storeData.is_o2o ? '开启' : '关闭' }}</view>
  48. </view>
  49. <view class="type type1">
  50. <view>门店自提:</view>
  51. <view class="message">{{ storeData.is_pickup ? '开启' : '关闭' }}</view>
  52. </view>
  53. <view class="type type1">
  54. <view>自提日期:</view>
  55. <view class="message" v-if="storeData.time_type == 1">
  56. <text class="week" v-if="storeData.time_week.includes('1') || storeData.time_week.includes(1)">周一</text>
  57. <text class="week" v-if="storeData.time_week.includes('2') || storeData.time_week.includes(2)">周二</text>
  58. <text class="week" v-if="storeData.time_week.includes('3') || storeData.time_week.includes(3)">周三</text>
  59. <text class="week" v-if="storeData.time_week.includes('4') || storeData.time_week.includes(4)">周四</text>
  60. <text class="week" v-if="storeData.time_week.includes('5') || storeData.time_week.includes(5)">周五</text>
  61. <text class="week" v-if="storeData.time_week.includes('6') || storeData.time_week.includes(6)">周六</text>
  62. <text class="week" v-if="storeData.time_week.includes('0') || storeData.time_week.includes(0)">周日</text>
  63. </view>
  64. <view class="message" v-if="storeData.time_type == 0">每天</view>
  65. </view>
  66. <view class="type type1">
  67. <view>自提时间:</view>
  68. <view class="message">{{ storeData.start_time }}-{{ storeData.end_time }}</view>
  69. </view>
  70. <view class="type type1">
  71. <view>库存设置:</view>
  72. <view class="message">{{ storeData.stock_type == 'all' ? '总部统一库存' : '门店独立库存' }}</view>
  73. </view>
  74. </view>
  75. <view class="btn" @click="$util.redirectTo('/pages/store/operate')">设置</view>
  76. </view>
  77. </view>
  78. <nc-loading :layer-background="{ background: 'rgba(255,255,255,.8)' }" ref="loading"></nc-loading>
  79. </view>
  80. </base-page>
  81. </template>
  82. <script>
  83. export default {
  84. data() {
  85. return {
  86. storeData: {
  87. store_name: '',
  88. store_image: '',
  89. status: 0,
  90. telphone: '',
  91. open_date: '',
  92. is_o2o: 0,
  93. is_pickup: 0,
  94. time_type: 0,
  95. start_time: '00:00',
  96. end_time: '23:59',
  97. stock_type: 'all',
  98. time_week: '',
  99. latitude: 39.909,
  100. longitude: 116.39742,
  101. province_id: 110000,
  102. city_id: 110100,
  103. district_id: 110101,
  104. address: '',
  105. full_address: '',
  106. store_type: 'directsale'
  107. },
  108. covers: [
  109. {
  110. latitude: 39.909,
  111. longitude: 116.39742,
  112. iconPath: '/static/location.png'
  113. }
  114. ],
  115. defaultRegions: []
  116. };
  117. },
  118. onLoad() {},
  119. onShow() {
  120. this.getData();
  121. },
  122. methods: {
  123. getData() {
  124. this.$api.sendRequest({
  125. url: '/store/storeapi/store/info',
  126. success: res => {
  127. if (res.code >= 0) {
  128. this.storeData = res.data;
  129. this.storeData.start_time = this.timeFormat(this.storeData.start_time);
  130. this.storeData.end_time = this.timeFormat(this.storeData.end_time);
  131. this.$refs.loading.hide();
  132. } else {
  133. this.$util.showToast({
  134. title: res.message
  135. });
  136. }
  137. }
  138. });
  139. },
  140. timeFormat(time) {
  141. let h = parseInt(time / 3600);
  142. let i = parseInt((time % 3600) / 60);
  143. h = h < 10 ? '0' + h : h;
  144. i = i < 10 ? '0' + i : i;
  145. return h + ':' + i;
  146. }
  147. }
  148. };
  149. </script>
  150. <style lang="scss">
  151. .common-form {
  152. margin: 0.15rem 0.2rem;
  153. }
  154. .store-information {
  155. width: 100%;
  156. background: #eff0f4;
  157. box-sizing: border-box;
  158. padding-bottom: 0.1rem;
  159. .store-status {
  160. font-size: 0.24rem;
  161. font-weight: bold;
  162. margin-bottom: 0.24rem;
  163. }
  164. .store-types {
  165. width: 100%;
  166. min-height: 1rem;
  167. background: #ffffff;
  168. padding: 0.2rem 0.3rem;
  169. display: flex;
  170. flex-direction: row;
  171. justify-content: space-between;
  172. margin-bottom: 0.2rem;
  173. box-sizing: border-box;
  174. position: relative;
  175. .info-left {
  176. display: flex;
  177. flex-direction: column;
  178. justify-content: space-between;
  179. }
  180. .btn {
  181. position: absolute;
  182. top: 0.2rem;
  183. right: 0.2rem;
  184. color: $uni-color-primary;
  185. cursor: pointer;
  186. }
  187. .info-img {
  188. margin-top: 0.4rem;
  189. image {
  190. max-width: 1.5rem;
  191. height: 1rem;
  192. }
  193. }
  194. .type {
  195. padding-left: 0.1rem;
  196. view {
  197. font-size: 0.14rem;
  198. .look {
  199. color: $uni-color-primary;
  200. margin-left: 0.24rem;
  201. }
  202. }
  203. view:nth-child(1) {
  204. width: 0.9rem;
  205. text-align: right;
  206. margin-right: 0.1rem;
  207. }
  208. }
  209. .type1 {
  210. display: flex;
  211. align-items: center;
  212. height: 0.34rem;
  213. }
  214. }
  215. .goods-info {
  216. min-height: 2.7rem;
  217. background: #ffffff;
  218. padding: 0.2rem;
  219. box-sizing: border-box;
  220. .title {
  221. font-size: 0.18rem;
  222. font-weight: 550;
  223. margin: 0.2rem 0;
  224. }
  225. .table {
  226. width: 100%;
  227. box-sizing: border-box;
  228. margin-bottom: 0.2rem;
  229. .table-all {
  230. width: 100%;
  231. display: flex;
  232. align-items: center;
  233. justify-content: space-between;
  234. padding: 0 0.38rem;
  235. box-sizing: border-box;
  236. .table-td {
  237. font-size: 0.14rem;
  238. text-align: left;
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. image {
  243. margin-right: 0.1rem;
  244. }
  245. }
  246. .table-goods-name {
  247. image {
  248. width: 0.6rem;
  249. height: 0.6rem;
  250. margin-right: 0.1rem;
  251. flex-shrink: 0;
  252. }
  253. }
  254. }
  255. .table-th {
  256. height: 0.56rem;
  257. background: #f7f8fa;
  258. }
  259. .table-tr {
  260. height: 0.7rem;
  261. border-bottom: 0.01rem solid #e6e6e6;
  262. .table-td {
  263. image {
  264. width: 0.5rem;
  265. height: 0.5rem;
  266. }
  267. .gift-tag {
  268. font-size: 0.12rem;
  269. background: #f00;
  270. margin-right: 0.05rem;
  271. color: #fff;
  272. line-height: 1;
  273. padding: 0.01rem 0.05rem;
  274. border-radius: 0.03rem;
  275. }
  276. .content-text {
  277. width: 80%;
  278. height: 0.4rem;
  279. text-overflow: -o-ellipsis-lastline;
  280. overflow: hidden;
  281. text-overflow: ellipsis;
  282. display: -webkit-box;
  283. -webkit-line-clamp: 2;
  284. line-clamp: 2;
  285. -webkit-box-orient: vertical;
  286. }
  287. }
  288. }
  289. .refund-success {
  290. color: $primary-color;
  291. font-size: 0.12rem;
  292. margin-top: 0.05rem;
  293. }
  294. }
  295. }
  296. }
  297. .week {
  298. margin-right: 0.1rem;
  299. }
  300. </style>