珠宝小程序前端代码
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.

273 lines
5.5 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <!-- 合伙人页面 -->
  2. <template>
  3. <view class="recruit">
  4. <!-- 导航栏 -->
  5. <navbar title="合伙人" leftClick @leftClick="$utils.navigateBack" bgColor="#E3441A" color="#fff" />
  6. <!-- 背景图 -->
  7. <view class="bg">
  8. <image :src="bg" mode="aspectFill" style="width: 100%;" class="bg-img"></image>
  9. </view>
  10. <!-- 表单 -->
  11. <view class="item-card">
  12. <view class="item-line">
  13. <view class="before"></view>
  14. <view class="label">合伙人</view>
  15. </view>
  16. <view class="item-line">
  17. <view class="label">您的姓名</view>
  18. <input placeholder="请输入姓名" v-model="partnership.name" />
  19. </view>
  20. <view class="item-line">
  21. <view class="label">联系方式</view>
  22. <input placeholder="请输入联系方式" v-model="partnership.phone" />
  23. </view>
  24. <view class="item-line">
  25. <view class="label">所在地区</view>
  26. <!-- <input placeholder="请输入所在地区" v-model="partnership.address" /> -->
  27. <view @click="openAreaSelector" class="area-info">
  28. <view class="area-detail">{{ partnership.address ? partnership.address : '请选择省市区' }}</view>
  29. <view class="arraw">
  30. <uv-icon name="arrow-right"></uv-icon>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="item-line">
  35. <view class="label">详细地址</view>
  36. <textarea v-model="partnership.addressdetail" placeholder="请输入详细地址"></textarea>
  37. </view>
  38. </view>
  39. <view class="b-fiexd">
  40. <view @click="submit" class="button-submit">{{ partnership.id ? '修改' : '新增' }}</view>
  41. </view>
  42. <AreaSelector ref="AreaSelector" @select="selectArea"></AreaSelector>
  43. </view>
  44. </template>
  45. <script>
  46. import AreaSelector from '../components/areaSelector/areaSelector.vue';
  47. export default {
  48. name: "Recruit",
  49. components: {
  50. AreaSelector
  51. },
  52. data() {
  53. return {
  54. partnership: {
  55. name: "",
  56. phone: "",
  57. address: "",
  58. addressdetail: ""
  59. }
  60. }
  61. },
  62. onShow() {
  63. this.getCommonUser();
  64. },
  65. methods: {
  66. //新增修改合伙人申请信息
  67. submit() {
  68. if (this.$utils.verificationAll(this.partnership, {
  69. name: '请输入你的姓名', //姓名
  70. phone: '请输入联系方式', //联系方式
  71. address: '请输入所在地区', //所在地区
  72. addressdetail: '请输入详细地址', //详细地址
  73. })) {
  74. return
  75. }
  76. this.$api('addOrUpdateCommonUser', this.partnership, res => {
  77. if (res.code == 200) {
  78. uni.showToast({
  79. title: this.partnership.id ? '修改成功' : '新增成功',
  80. icon: "none"
  81. })
  82. setTimeout(uni.navigateBack, 800, -1)
  83. }
  84. })
  85. },
  86. //获取合伙人申请
  87. getCommonUser() {
  88. this.$api('getCommonUser', res => {
  89. if (res.code == 200 && res.result) {
  90. const {
  91. id,
  92. name,
  93. phone,
  94. address,
  95. addressdetail
  96. } = res.result;
  97. this.partnership = {
  98. id,
  99. name,
  100. phone,
  101. address,
  102. addressdetail
  103. }
  104. }
  105. })
  106. },
  107. //打开省市区选择
  108. openAreaSelector() {
  109. this.$refs.AreaSelector.open();
  110. },
  111. //用户选择了省市区信息
  112. selectArea(area) {
  113. this.partnership.address = area;
  114. }
  115. },
  116. computed: {
  117. bg() {
  118. let arr = [];
  119. if (this.configList?.shop_get_image) {
  120. arr = this.configList?.shop_get_image?.split(',')
  121. }
  122. return arr[0] || ''
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="scss" scoped>
  128. .recruit {
  129. // 背景图
  130. .bg {
  131. width: 710rpx;
  132. margin: 20rpx auto 0rpx auto;
  133. .bg-img {
  134. width: 100%;
  135. height: 250rpx;
  136. border-radius: 10rpx;
  137. }
  138. }
  139. // 表单
  140. .item-card {
  141. width: calc(710rpx - 40rpx);
  142. height: auto;
  143. background: #ffffff;
  144. border-radius: 16rpx;
  145. margin: 40rpx auto 20rpx;
  146. padding: 40rpx 20rpx;
  147. }
  148. .item-line {
  149. display: flex;
  150. flex-wrap: wrap;
  151. height: 60rpx;
  152. font-size: 28rpx;
  153. font-family: PingFang SC, PingFang SC-Bold;
  154. font-weight: 700;
  155. text-align: left;
  156. color: #333333;
  157. margin-bottom: 40rpx;
  158. &:nth-child(1) {
  159. margin-bottom: 20rpx;
  160. .label {
  161. font-size: 36rpx;
  162. }
  163. }
  164. &:last-child {
  165. margin-bottom: 0rpx;
  166. height: auto;
  167. }
  168. }
  169. .item-line .before {
  170. content: "";
  171. width: 8rpx;
  172. height: 30rpx;
  173. background: $uni-color;
  174. border-radius: 4rpx;
  175. margin-right: 10rpx;
  176. margin-top: 15rpx;
  177. }
  178. .item-line .label {
  179. display: flex;
  180. align-items: center;
  181. width: 152rpx;
  182. height: 60rpx;
  183. }
  184. .item-line .area-info {
  185. height: 60rpx;
  186. display: flex;
  187. align-items: center;
  188. justify-content: space-between;
  189. width: calc(100% - 152rpx);
  190. padding: 0rpx 20rpx;
  191. box-sizing: border-box;
  192. .area-detail {
  193. width: 95%;
  194. white-space: nowrap;
  195. overflow: hidden;
  196. text-overflow: ellipsis;
  197. color: #939393;
  198. font-weight: normal;
  199. }
  200. .arraw {
  201. width: 5%;
  202. }
  203. }
  204. .item-line input,
  205. .item-line textarea {
  206. width: calc(100% - 152rpx);
  207. height: 60rpx;
  208. background: #f5f5f5;
  209. border-radius: 12rpx;
  210. font-size: 24rpx;
  211. font-family: PingFang SC, PingFang SC-Medium;
  212. font-weight: 500;
  213. text-align: left;
  214. color: #939393;
  215. padding: 0 20rpx;
  216. box-sizing: border-box;
  217. }
  218. .item-line textarea {
  219. height: 120rpx;
  220. padding: 20rpx;
  221. }
  222. .b-fiexd {
  223. position: fixed;
  224. left: 0;
  225. bottom: 0;
  226. width: 100%;
  227. .button-submit {
  228. display: flex;
  229. align-items: center;
  230. justify-content: center;
  231. width: 596rpx;
  232. height: 90rpx;
  233. background: #E3441A;
  234. border-radius: 46rpx;
  235. margin: 20rpx auto;
  236. font-size: 28rpx;
  237. font-family: PingFang SC, PingFang SC-Regular;
  238. font-weight: 400;
  239. text-align: center;
  240. color: #ffffff;
  241. }
  242. }
  243. }
  244. </style>