basics.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="">
  3. <view class="step">
  4. <uni-steps active-color="#FF6A69" :options="[
  5. {title: '注册账号',url:'./getShop'},
  6. {title: '扫码授权',url:'./qrCode'},
  7. {title: '提交支付资质',url:'./addPay'},
  8. {title: '基础信息',url:'./basics'} ]" :active="3"></uni-steps>
  9. </view>
  10. <view style="height: 130rpx;"></view>
  11. <form @submit="onSubmit">
  12. <view class="box-pack-between item flex-y-center border-b" style="padding: 30rpx;">
  13. <text>基本信息</text>
  14. </view>
  15. <view class="content">
  16. <view class="item flex flex-y-center">
  17. <view class="title-block required">
  18. <text>小程序名称</text>
  19. </view>
  20. <view class="desc">
  21. <input type="text" :value="info.nickname" name="nickname" class="input-box"
  22. placeholder="请输入小程序名称" placeholder-class="desc-placeholder">
  23. </view>
  24. </view>
  25. <view class="item flex flex-y-center">
  26. <view class="title-block required">
  27. <text>小程序简称</text>
  28. </view>
  29. <view class="desc">
  30. <input type="text" :value="info.abbr" name="abbr" class="input-box" placeholder="请输入小程序简称"
  31. placeholder-class="desc-placeholder">
  32. </view>
  33. </view>
  34. <view class="item flex flex-y-center">
  35. <view class="title-block required">
  36. <text>介绍内容</text>
  37. </view>
  38. <view class="desc">
  39. <input type="text" :value="info.introduction" name="introduction" class="input-box"
  40. placeholder="请输入介绍内容" placeholder-class="desc-placeholder">
  41. </view>
  42. </view>
  43. </view>
  44. <view class="box-pack-between item flex-y-center border-b" style="padding: 30rpx;margin-top: 20rpx;">
  45. <text>退货信息</text>
  46. </view>
  47. <view class="item flex flex-y-center">
  48. <view class="title-block required">
  49. <text>收货人姓名</text>
  50. </view>
  51. <view class="desc">
  52. <input type="text" :value="info.user_name" name="user_name" class="input-box" placeholder="请输入收货人姓名"
  53. placeholder-class="desc-placeholder">
  54. </view>
  55. </view>
  56. <view class="item flex flex-y-center">
  57. <view class="title-block required">
  58. <text>邮箱</text>
  59. </view>
  60. <view class="desc">
  61. <input type="text" :value="info.mail" name="mail" class="input-box" placeholder="请输入邮箱"
  62. placeholder-class="desc-placeholder">
  63. </view>
  64. </view>
  65. <view class="item flex flex-y-center">
  66. <view class="title-block required">
  67. <text>联系号码</text>
  68. </view>
  69. <view class="desc">
  70. <input type="text" :value="info.tel_number" name="tel_number" class="input-box"
  71. placeholder="请输入联系号码" placeholder-class="desc-placeholder">
  72. </view>
  73. </view>
  74. <view class="item flex flex-y-center box-pack-between" @click="open">
  75. <view class="title-block required">
  76. <text>商户地址</text>
  77. </view>
  78. <view class="desc">
  79. {{address.Prov_title}} {{address.City_title}} {{address.Dist_title}}
  80. <text class="iconfont icongengduo"></text>
  81. </view>
  82. </view>
  83. <!-- <view class="bgf mar-24 item box-pack-between" @click="open" data-type="1">
  84. <text class="ft28">商户地址</text>
  85. <view class=" flex-y-center br desc">
  86. <view class="flex-y-center ft26">
  87. {{address.Prov_title}} {{address.City_title}} {{address.Dist_title}}
  88. <text class="iconfont icongengduo"></text>
  89. </view>
  90. </view>
  91. </view> -->
  92. <view class="item flex flex-y-center">
  93. <view class="title-block required">
  94. <text>详细地址</text>
  95. </view>
  96. <view class="desc">
  97. <input type="text" :value="info.detail_info" name="detail_info" class="input-box"
  98. placeholder="请输入详细地址" placeholder-class="desc-placeholder">
  99. </view>
  100. </view>
  101. <button class="sub-btn" hover-class="none" form-type="submit">
  102. 立即提交
  103. </button>
  104. </form>
  105. <uni-popup ref="uniScroll" type="bottom">
  106. <uni-scroll :Prov_arr="Prov_arr" @select="select"></uni-scroll>
  107. </uni-popup>
  108. </view>
  109. </template>
  110. <script>
  111. import uniScroll from '../components/uni-scroll/uni-scroll.vue'
  112. export default {
  113. components: {
  114. uniScroll,
  115. },
  116. data() {
  117. return {
  118. Prov_arr: [],
  119. address: {
  120. Prov_title: "请选择",
  121. City_title: "",
  122. Dist_title: "",
  123. },
  124. info:{}
  125. }
  126. },
  127. onLoad() {
  128. this.wechat_store();
  129. this.Prov();
  130. },
  131. methods: {
  132. open(e) {
  133. var type = e.currentTarget.dataset.type;
  134. this.$refs.uniScroll.open();
  135. },
  136. wechat_store() {
  137. this.request({
  138. url: 'Wechatstore/wechat_store',
  139. data: {
  140. admin_id: uni.getStorageSync("admin_id"),
  141. }
  142. }).then(res => {
  143. this.info = res.data;
  144. this.address = {
  145. Prov_title: res.data.province_name,
  146. Prov_code: res.data.s_province,
  147. City_title: res.data.city_name,
  148. City_code: res.data.s_city,
  149. Dist_title: res.data.county_name,
  150. Dist_code: res.data.s_area,
  151. }
  152. })
  153. },
  154. // 获取省
  155. Prov(e) {
  156. this.request({
  157. url: "setting/getprovince",
  158. data: {},
  159. }).then(res => {
  160. console.log(res, "res")
  161. if (res.code === '200') {
  162. this.Prov_arr = res.data;
  163. }
  164. });
  165. },
  166. // 获取地址
  167. select(e) {
  168. console.log(e)
  169. this.address = e;
  170. },
  171. onSubmit(e) {
  172. let data = e.detail.value;
  173. data.admin_id = uni.getStorageSync("admin_id");
  174. data.s_province = this.address.Prov_code;
  175. data.s_city = this.address.City_code;
  176. data.s_area = this.address.Dist_code;
  177. // console.log(data, "data")
  178. // return
  179. this.request({
  180. url: "Wechatstore/submit_basicinfo",
  181. data: data,
  182. }).then(res => {
  183. if (res.code == 200) {
  184. uni.showToast({
  185. title: res.message,
  186. icon: 'none'
  187. })
  188. setTimeout(() => {
  189. uni.navigateBack()
  190. }, 2000)
  191. }
  192. }).catch((res) => {
  193. uni.showToast({
  194. title: res.message,
  195. icon: 'none'
  196. })
  197. })
  198. },
  199. }
  200. }
  201. </script>
  202. <style>
  203. page {
  204. background-color: #F4F5F7;
  205. }
  206. .item {
  207. background-color: #FFF;
  208. padding: 0 25rpx;
  209. }
  210. .title-block {
  211. margin-right: 20rpx;
  212. max-width: 220rpx;
  213. }
  214. .title-block text {
  215. font-size: 28rpx;
  216. }
  217. .desc {
  218. text-align: right;
  219. flex: 1;
  220. padding: 25rpx 0;
  221. border-bottom: 1rpx solid #F1F1F1;
  222. }
  223. .rund {
  224. width: 40rpx;
  225. height: 40rpx;
  226. }
  227. .red {
  228. color: red;
  229. padding: 10rpx 25rpx;
  230. font-size: 26rpx;
  231. }
  232. .sub-btn {
  233. width: 690rpx;
  234. height: 100rpx;
  235. background: linear-gradient(315deg, #FF6A69 2%, #FF6A69 99%);
  236. border-radius: 8rpx;
  237. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
  238. text-align: center;
  239. line-height: 100rpx;
  240. color: #fff;
  241. font-size: 36rpx;
  242. font-weight: bold;
  243. margin: 0 auto;
  244. margin-top: 30px;
  245. }
  246. </style>