酒店桌布为微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

316 lines
6.5 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="applyLaundryStore">
  3. <navbar title="申请水洗店" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <view class="title">
  6. <span
  7. style="width: 10rpx;height: 40rpx;background-color: #f78142;border-radius: 10rpx;overflow: hidden;"></span>
  8. <span>店铺信息</span>
  9. </view>
  10. <view class="shopName">
  11. <view>店铺名称</view>
  12. <view>
  13. <input v-model="form.name" placeholder="请输入店铺名称" clearable></input>
  14. </view>
  15. </view>
  16. <view class="shopName">
  17. <view>您的姓名</view>
  18. <view>
  19. <input v-model="form.userName" placeholder="请输入您的姓名" clearable></input>
  20. </view>
  21. </view>
  22. <view class="shopName">
  23. <view>联系方式</view>
  24. <view>
  25. <input v-model="form.phone" type="number" placeholder="请输入联系方式" clearable></input>
  26. </view>
  27. </view>
  28. <view class="currentRegion">
  29. <view>所在地区</view>
  30. <view>
  31. <input class="input" v-model="form.currentRegion" placeholder="请选择所在地区"></input>
  32. <view class="orientation" @click.stop="selectAddr">
  33. 定位
  34. <image src="../static/address/selectIcon.png"
  35. style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;"></image>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="shopName">
  40. <view>详细地址</view>
  41. <view>
  42. <input v-model="form.address" placeholder="详细地址" clearable></input>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 底部按钮 -->
  47. <bottomBtn @confirm='submitApplication()' :color='bottomBtnStyle.color'
  48. :backgroundColor='bottomBtnStyle.backgroundColor' :fontSize='bottomBtnStyle.fontSize'
  49. :text='bottomBtnStyle.text' :width="bottomBtnStyle.width" :height="bottomBtnStyle.height"
  50. :borderRadius='bottomBtnStyle.borderRadius' :bottom='bottomBtnStyle.bottom'>
  51. </bottomBtn>
  52. </view>
  53. </template>
  54. <script>
  55. import Position from '@/utils/position.js'
  56. import bottomBtn from "../../components/bottom/bottomBtn.vue"
  57. export default {
  58. components: {
  59. bottomBtn,
  60. },
  61. data() {
  62. return {
  63. form: {
  64. userName: '',
  65. name: '',
  66. phone: '',
  67. currentRegion: '',
  68. address: '',
  69. latitude: '',
  70. longitude: '',
  71. },
  72. bottomBtnStyle: {
  73. color: '#FFF',
  74. backgroundColor: '#fd5100',
  75. fontSize: '34rpx',
  76. text: '提交',
  77. width: '400rpx',
  78. height: '80rpx',
  79. borderRadius: '100rpx',
  80. bottom: '40rpx'
  81. },
  82. }
  83. },
  84. computed: {
  85. },
  86. onShow() {
  87. },
  88. methods: {
  89. // 提交按钮
  90. submitApplication() {
  91. this.form.address = this.form.currentRegion + this.form.address
  92. this.$api('applyShopHotel', this.form, res => {
  93. if (res.code == 200) {
  94. uni.showToast({
  95. title: '申请成功待审核', // 提示的内容
  96. icon: 'success', // 图标,可选值有 'success', 'loading', 'none'
  97. duration: 1500 // 提示的持续时间,默认是1500毫秒
  98. });
  99. setTimeout(() => {
  100. uni.navigateTo({
  101. url: '/pages/index/center'
  102. })
  103. }, 1500)
  104. }
  105. })
  106. },
  107. //地图上选择地址
  108. selectAddr() {
  109. Position.getLocation(res => {
  110. Position.selectAddress(res.longitude, res.latitude, success => {
  111. this.setAddress(success)
  112. })
  113. })
  114. Position.getLocationDetail(res => {
  115. console.log(res);
  116. this.form.address = res
  117. })
  118. },
  119. //提取用户选择的地址信息复制给表单数据
  120. setAddress(res) {
  121. //经纬度信息
  122. this.form.latitude = res.latitude
  123. this.form.longitude = res.longitude
  124. if (!res.address && res.name) { //用户直接选择城市的逻辑
  125. return this.form.currentRegion = res.name
  126. }
  127. if (res.address || res.name) {
  128. return this.form.currentRegion = res.address + res.name
  129. }
  130. this.form.currentRegion = '' //用户啥都没选就点击勾选
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. * {
  137. box-sizing: border-box;
  138. }
  139. .applyLaundryStore {
  140. padding: 0 20rpx 0 20rpx;
  141. background-color: #f5f5f5;
  142. .frame {
  143. display: flex;
  144. flex-direction: column;
  145. gap: 20rpx;
  146. background-color: #FFF;
  147. margin-top: 20rpx;
  148. padding: 20rpx;
  149. .title {
  150. display: flex;
  151. // padding-top: 40rpx;
  152. font-size: 34rpx;
  153. font-weight: 700;
  154. padding: 0 0 0 20rpx;
  155. >span:nth-of-type(1) {
  156. margin: 4rpx 0 0 8rpx;
  157. background-color: #FFF;
  158. }
  159. >span:nth-of-type(2) {
  160. margin: 0 0 0 8rpx;
  161. background-color: #FFF;
  162. }
  163. }
  164. .shopName {
  165. display: flex;
  166. align-items: center;
  167. background-color: #FFF;
  168. height: 80rpx;
  169. // margin: 10rpx 0 0 0;
  170. padding: 10rpx 0 0 20rpx;
  171. >view:nth-of-type(1) {
  172. width: 30%;
  173. // font-weight: 700;
  174. }
  175. >view:nth-of-type(2) {
  176. width: 70%;
  177. // padding: 0 20rpx 0 0;
  178. border-radius: 10rpx;
  179. overflow: hidden;
  180. input {
  181. background-color: #f5f5f5;
  182. // color: #a4a4a4;
  183. font-size: 28rpx;
  184. padding: 8rpx 8rpx 8rpx 15rpx;
  185. }
  186. }
  187. }
  188. .name {
  189. display: flex;
  190. align-items: center;
  191. background-color: #FFF;
  192. height: 80rpx;
  193. // margin: 10rpx 0 0 0;
  194. padding: 10rpx 0 0 20rpx;
  195. >view:nth-of-type(1) {
  196. width: 30%;
  197. font-weight: 700;
  198. }
  199. >view:nth-of-type(2) {
  200. width: 70%;
  201. padding: 0 20rpx 0 0;
  202. }
  203. }
  204. .phone {
  205. display: flex;
  206. align-items: center;
  207. background-color: #FFF;
  208. height: 80rpx;
  209. // margin: 10rpx 0 0 0;
  210. padding: 10rpx 0 0 20rpx;
  211. >view:nth-of-type(1) {
  212. width: 30%;
  213. font-weight: 700;
  214. }
  215. >view:nth-of-type(2) {
  216. width: 70%;
  217. padding: 0 20rpx 0 0;
  218. }
  219. }
  220. .currentRegion {
  221. display: flex;
  222. align-items: center;
  223. background-color: #FFF;
  224. height: 80rpx;
  225. // margin: 10rpx 0 0 0;
  226. padding: 10rpx 0 0 20rpx;
  227. >view:nth-of-type(1) {
  228. width: 30%;
  229. // font-weight: 700;
  230. }
  231. >view:nth-of-type(2) {
  232. width: 70%;
  233. padding: 0 20rpx 0 0;
  234. display: flex;
  235. .input {
  236. background-color: #f5f5f5;
  237. // color: #a4a4a4;
  238. font-size: 28rpx;
  239. padding: 8rpx 8rpx 8rpx 15rpx;
  240. width: 300rpx;
  241. }
  242. .orientation {
  243. display: flex;
  244. padding: 10rpx 10rpx 10rpx 20rpx;
  245. font-size: 30rpx;
  246. color: #FBAB32;
  247. }
  248. }
  249. }
  250. .detailedAddress {
  251. display: flex;
  252. align-items: center;
  253. background-color: #FFF;
  254. height: 80rpx;
  255. // margin: 10rpx 0 0 0;
  256. padding: 10rpx 0 0 20rpx;
  257. >view:nth-of-type(1) {
  258. width: 30%;
  259. font-weight: 700;
  260. }
  261. >view:nth-of-type(2) {
  262. width: 70%;
  263. padding: 0 20rpx 0 0;
  264. }
  265. }
  266. }
  267. }
  268. </style>