add.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <view class="container">
  3. <form @submit="onSubmit">
  4. <view class="page-block">
  5. <view class="content">
  6. <view class="cell flex flex-y-center box-pack-between">
  7. <view class="title-block required">
  8. <text>合伙人:</text>
  9. </view>
  10. <navigator url="./userList" class="">
  11. {{user_name}}
  12. <text class="iconfont icongengduo"></text>
  13. </navigator>
  14. </view>
  15. <view class="cell flex flex-y-center">
  16. <view class="title-block required">
  17. <text>合伙人等级:</text>
  18. </view>
  19. <view class="desc">
  20. <picker mode="selector" :range="tableTypeList" range-key="name"
  21. @change="onTableTypeChange">
  22. <view class="box-pack-between">
  23. <text>{{tableTypeActive}}</text>
  24. <text class="iconfont icongengduo"></text>
  25. </view>
  26. </picker>
  27. </view>
  28. </view>
  29. <view class="cell flex flex-y-center">
  30. <view class="title-block">
  31. <text>结算方式:</text>
  32. </view>
  33. <view class="desc">
  34. <input type="text" name="content" class="input-box"
  35. placeholder="请输入结算方式" placeholder-class="desc-placeholder">
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="footer-bar">
  41. <view class="content flex flex-center" style="background: none;">
  42. <button class="btn" hover-class="none" form-type="submit">
  43. 立即添加
  44. </button>
  45. </view>
  46. </view>
  47. </form>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. level_id: "",
  55. info: {},
  56. type: 2,
  57. user_name:'选择用户',
  58. user_id:'',
  59. admin_id: '',
  60. tableTypeList:[],
  61. tableTypeActive:'',
  62. }
  63. },
  64. onLoad(e) {
  65. this.admin_id = uni.getStorageSync("admin_id");
  66. this.shop_store_index();
  67. },
  68. methods: {
  69. shop_store_index() {
  70. this.request({
  71. url: 'Smdcshop/shared_users_level',
  72. data: {
  73. admin_id:this.admin_id,
  74. }
  75. }).then(res => {
  76. if (res.code == 200) {
  77. this.tableTypeList = res.data;
  78. }
  79. })
  80. },
  81. onTableTypeChange(e) {
  82. this.tableTypeActive = this.tableTypeList[e.detail.value].name;
  83. this.level_id = this.tableTypeList[e.detail.value].id
  84. },
  85. choicepay(e) {
  86. this.sex = e;
  87. },
  88. onSubmit(e) {
  89. let params = e.detail.value,
  90. url;
  91. params.admin_id=this.admin_id;
  92. params.level = this.level_id;
  93. params.user_id = this.user_id;
  94. url = "Smdcshop/shared_users_add";
  95. if (!params.user_id || !params.level ) {
  96. uni.showToast({
  97. title: "必须不能为空",
  98. icon: 'none'
  99. })
  100. return false
  101. }
  102. this.request({
  103. url: url,
  104. data: params
  105. }).then(res => {
  106. if (res.code == 200) {
  107. uni.showToast({
  108. title: res.message,
  109. icon: 'none'
  110. })
  111. setTimeout(() => {
  112. uni.navigateBack()
  113. }, 2000)
  114. }
  115. }).catch((res) => {
  116. uni.showToast({
  117. title: res.message,
  118. icon: 'none'
  119. })
  120. });
  121. },
  122. }
  123. }
  124. </script>
  125. <style>
  126. page {
  127. background-color: #F4F5F7;
  128. }
  129. .checklist-box {
  130. display: -webkit-box;
  131. display: -webkit-flex;
  132. display: flex;
  133. -webkit-box-orient: horizontal;
  134. -webkit-box-direction: normal;
  135. -webkit-flex-direction: row;
  136. flex-direction: row;
  137. -webkit-box-align: center;
  138. -webkit-align-items: center;
  139. align-items: center;
  140. margin: 5px 0;
  141. margin-right: 22px;
  142. }
  143. .radio__inner {
  144. -webkit-flex-shrink: 0;
  145. flex-shrink: 0;
  146. display: -webkit-box;
  147. display: -webkit-flex;
  148. display: flex;
  149. -webkit-box-pack: center;
  150. -webkit-justify-content: center;
  151. justify-content: center;
  152. -webkit-box-align: center;
  153. -webkit-align-items: center;
  154. align-items: center;
  155. position: relative;
  156. border: 1px solid #DCDFE6;
  157. border-radius: 2px;
  158. box-sizing: border-box;
  159. width: 16px;
  160. height: 16px;
  161. border-radius: 16px;
  162. background-color: #fff;
  163. z-index: 1;
  164. -webkit-transition: border-color .3s;
  165. transition: border-color .3s;
  166. }
  167. .radio__inner-icon {
  168. width: 8px;
  169. height: 8px;
  170. border-radius: 10px;
  171. opacity: 0;
  172. -webkit-transition: -webkit-transform .3s;
  173. transition: -webkit-transform .3s;
  174. transition: transform .3s;
  175. transition: transform .3s, -webkit-transform .3s;
  176. }
  177. .is-default-checked {
  178. opacity: 1;
  179. background-color: #007aff;
  180. -webkit-transform: rotate(45deg) scaleY(1);
  181. transform: rotate(45deg) scaleY(1);
  182. }
  183. .checklist-text {
  184. font-size: 28rpx;
  185. margin-left: 5px;
  186. -webkit-transition: color 0.2s;
  187. transition: color 0.2s;
  188. color: #000;
  189. }
  190. .act_border {
  191. border: 1rpx solid #007aff;
  192. }
  193. /* */
  194. .page-block {}
  195. .page-block .page-title-block {
  196. padding: 20rpx 25rpx;
  197. }
  198. .page-block .page-title-block .title {
  199. font-size: 28rpx;
  200. line-height: 40rpx;
  201. color: #999;
  202. }
  203. .page-block .content {
  204. padding: 0 25rpx;
  205. background-color: #fff;
  206. }
  207. .page-block .cell {
  208. min-height: 100rpx;
  209. border-bottom: 1rpx solid #f5f5f5;
  210. }
  211. .page-block .cell:last-child {
  212. border-bottom: none;
  213. }
  214. .page-block .cell .title-block {
  215. min-width: 155rpx;
  216. flex: none;
  217. font-size: 30rpx;
  218. color: #333;
  219. font-weight: 600;
  220. padding-right: 20rpx;
  221. }
  222. .page-block .cell .required::after {
  223. content: "*";
  224. color: #f00;
  225. }
  226. .page-block .cell .desc {
  227. flex: auto;
  228. height: 100%;
  229. }
  230. .page-block .cell .desc .desc-info{
  231. padding:30rpx 0;
  232. font-size: 28rpx;
  233. color: #999;
  234. line-height: 40rpx;
  235. }
  236. .page-block .cell .input-box {
  237. height: 100rpx;
  238. line-height: 100rpx;
  239. font-size: 28rpx;
  240. /* color: #999; */
  241. }
  242. .page-block .radio-btn {
  243. zoom: 0.7;
  244. }
  245. .page-block .radio-text {
  246. margin: 0 40rpx 0 8rpx;
  247. font-size: 28rpx;
  248. color: #999;
  249. }
  250. /* */
  251. .footer-bar {
  252. height: 160rpx;
  253. /*兼容 IOS<11.2*/
  254. padding-bottom: constant(safe-area-inset-bottom);
  255. /*兼容 IOS>11.2*/
  256. padding-bottom: env(safe-area-inset-bottom);
  257. box-sizing: content-box;
  258. }
  259. .footer-bar .content {
  260. width: 100%;
  261. height: 160rpx;
  262. background-color: #fff;
  263. position: fixed;
  264. left: 0;
  265. bottom: 0;
  266. z-index: 100;
  267. /*兼容 IOS<11.2*/
  268. padding-bottom: constant(safe-area-inset-bottom);
  269. /*兼容 IOS>11.2*/
  270. padding-bottom: env(safe-area-inset-bottom);
  271. box-sizing: content-box;
  272. box-shadow: 0 -5rpx 10rpx #eee;
  273. }
  274. .footer-bar .content .btn {
  275. width: 700rpx;
  276. height: 100rpx;
  277. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  278. border-radius: 8rpx;
  279. box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(51, 135, 255, 0.20);
  280. text-align: center;
  281. line-height: 100rpx;
  282. font-size: 36rpx;
  283. font-weight: 500;
  284. color: #fff;
  285. }
  286. .footer-bar .content .detail-btn {
  287. width: 50%;
  288. height: 40rpx;
  289. }
  290. .footer-bar .content .detail-btn .btn-icon {
  291. flex: none;
  292. display: block;
  293. width: 32rpx;
  294. height: 32rpx;
  295. margin-right: 8rpx;
  296. }
  297. </style>