敢为人鲜小程序前端代码仓库
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.

229 lines
4.6 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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>
  28. <view class="item-line">
  29. <view class="label">详细地址</view>
  30. <textarea v-model="partnership.addressdetail" placeholder="请输入详细地址"></textarea>
  31. </view>
  32. </view>
  33. <view class="b-fiexd">
  34. <view @click="submit" class="button-submit">{{ partnership.id ? '修改' : '新增' }}</view>
  35. </view>
  36. <!-- <AreaSelector></AreaSelector> -->
  37. </view>
  38. </template>
  39. <script>
  40. // import AreaSelector from "../components/areaSelector/areaSelector.vue"
  41. export default {
  42. name: "Recruit",
  43. components : { AreaSelector },
  44. data() {
  45. return {
  46. partnership: {
  47. name: "",
  48. phone: "",
  49. address: "",
  50. addressdetail: ""
  51. }
  52. }
  53. },
  54. onShow() {
  55. this.getCommonUser();
  56. },
  57. methods: {
  58. //新增修改合伙人申请信息
  59. submit() {
  60. if (this.$utils.verificationAll(this.partnership, {
  61. name: '请输入你的姓名', //姓名
  62. phone: '请输入联系方式', //联系方式
  63. address: '请输入所在地区', //所在地区
  64. addressdetail: '请输入详细地址', //详细地址
  65. })) {
  66. return
  67. }
  68. this.$api('addOrUpdateCommonUser', this.partnership, res => {
  69. if (res.code == 200) {
  70. uni.showToast({
  71. title: this.partnership.id ? '修改成功' : '新增成功',
  72. icon: "none"
  73. })
  74. setTimeout(uni.navigateBack, 800, -1)
  75. }
  76. })
  77. },
  78. //获取合伙人申请
  79. getCommonUser() {
  80. this.$api('getCommonUser', res => {
  81. if (res.code == 200) {
  82. const {
  83. id,
  84. name,
  85. phone,
  86. address,
  87. addressdetail
  88. } = res.result;
  89. this.partnership = {
  90. id,
  91. name,
  92. phone,
  93. address,
  94. addressdetail
  95. }
  96. }
  97. })
  98. }
  99. },
  100. computed: {
  101. bg() {
  102. let arr = [];
  103. if (this.configList?.shop_get_image) {
  104. arr = this.configList?.shop_get_image?.split(',')
  105. }
  106. return arr[0] || ''
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .recruit {
  113. // 背景图
  114. .bg {
  115. width: 710rpx;
  116. margin: 20rpx auto 0rpx auto;
  117. .bg-img {
  118. width: 100%;
  119. height: 250rpx;
  120. border-radius: 10rpx;
  121. }
  122. }
  123. // 表单
  124. .item-card {
  125. width: calc(710rpx - 40rpx);
  126. height: auto;
  127. background: #ffffff;
  128. border-radius: 16rpx;
  129. margin: 40rpx auto 20rpx;
  130. padding: 40rpx 20rpx;
  131. }
  132. .item-line {
  133. display: flex;
  134. height: 60rpx;
  135. font-size: 28rpx;
  136. font-family: PingFang SC, PingFang SC-Bold;
  137. font-weight: 700;
  138. text-align: left;
  139. color: #333333;
  140. margin-bottom: 40rpx;
  141. &:nth-child(1) {
  142. margin-bottom: 20rpx;
  143. .label {
  144. font-size: 36rpx;
  145. }
  146. }
  147. &:last-child {
  148. margin-bottom: 0rpx;
  149. height: auto;
  150. }
  151. }
  152. .item-line .before {
  153. content: "";
  154. width: 8rpx;
  155. height: 30rpx;
  156. background: $uni-color;
  157. border-radius: 4rpx;
  158. margin-right: 10rpx;
  159. margin-top: 15rpx;
  160. }
  161. .item-line .label {
  162. display: flex;
  163. align-items: center;
  164. width: 152rpx;
  165. height: 60rpx;
  166. }
  167. .item-line input,
  168. .item-line textarea {
  169. width: 90%;
  170. height: 60rpx;
  171. background: #f5f5f5;
  172. border-radius: 12rpx;
  173. font-size: 24rpx;
  174. font-family: PingFang SC, PingFang SC-Medium;
  175. font-weight: 500;
  176. text-align: left;
  177. color: #939393;
  178. padding: 0 20rpx;
  179. }
  180. .item-line textarea {
  181. height: 120rpx;
  182. padding: 20rpx;
  183. }
  184. .b-fiexd {
  185. position: fixed;
  186. left: 0;
  187. bottom: 0;
  188. width: 100%;
  189. .button-submit {
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. width: 596rpx;
  194. height: 90rpx;
  195. background: #E3441A;
  196. border-radius: 46rpx;
  197. margin: 20rpx auto;
  198. font-size: 28rpx;
  199. font-family: PingFang SC, PingFang SC-Regular;
  200. font-weight: 400;
  201. text-align: center;
  202. color: #ffffff;
  203. }
  204. }
  205. }
  206. </style>