goods-attr-info.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. <template>
  2. <app-layout>
  3. <view class="group main-center cross-center">
  4. <view @click="choose(item,index)" v-for="(item,index) in attr_groups" :key="index" class="box-grow-1 group-item main-center cross-center">
  5. <view :class="['group-name', 't-omit', `${item.choose? 'active':''}`]">{{item.choose ? item.choose_attr : item.attr_group_name}}</view>
  6. <image v-if="showGroup && groupIndex == index" class="more" :src="item.choose ? './../image/close.png' :'/static/image/icon/icon-up.png'"></image>
  7. <image class="more" v-else :src="item.choose ? './../image/open.png' :'/static/image/icon/icon-down.png'"></image>
  8. </view>
  9. </view>
  10. <view class="attr-group-holder"></view>
  11. <view>
  12. <view class="attr-item" v-if="item.show == listLength" v-for="(item,index) in attr" :key="item.id">
  13. <template v-if="startIndex < item.showIndex && item.showIndex < endIndex">
  14. <view class="attr-name">
  15. <view class="check" @click="unSelect(item,index)">
  16. <image src="/static/image/icon/icon-uncheck.png" v-if="!item.select"></image>
  17. <image src="./../image/active.png" v-else></image>
  18. </view>
  19. <view class="dir-left-wrap cross-center">
  20. <view class="attr-group" v-for="(attr,idx) in item.attr_list" :key="idx">
  21. <text class="attr-group-name">{{attr.attr_group_name}}:</text>
  22. <text>{{attr.attr_name}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view style="background-color: #fff">
  27. <view class='info-item cross-center dir-left-nowrap'>
  28. <view class="form-label">售价</view>
  29. <view class='dir-left-nowrap price-input cross-center main-between'>
  30. <input
  31. :value="item.price"
  32. :focus="inputName && chooseIndex == item.id"
  33. @blur="nameBlur(item.id,$event)"
  34. v-if="inputName && chooseIndex == item.id"
  35. placeholder-style="color: #cdcdcd"
  36. placeholder="请输入售价"
  37. type='digit'
  38. class='input'
  39. />
  40. <view v-else :class="item.price ? 'input input-item' : 'input input-item placeholder'" @click="nameBlur(item.id)">{{item.price ? item.price :'请输入售价'}}</view>
  41. <view>元</view>
  42. </view>
  43. </view>
  44. <view class='info-item cross-center dir-left-nowrap'>
  45. <view class="form-label">库存</view>
  46. <view class='dir-left-nowrap price-input cross-center main-between'>
  47. <input
  48. :focus="inputStock && chooseIndex == item.id"
  49. @blur="stockBlur(item.id,$event)"
  50. v-if="inputStock && chooseIndex == item.id"
  51. placeholder-style="color: #cdcdcd"
  52. placeholder="请输入库存"
  53. type='number'
  54. class='input unit'
  55. :value="item.stock"
  56. />
  57. <view v-else :class="item.stock ? 'input unit input-item' : 'input unit input-item placeholder'" @click="stockBlur(item.id)">{{item.stock ? item.stock :'请输入库存'}}</view>
  58. <view class="unit-width">{{unit}}</view>
  59. </view>
  60. </view>
  61. <view class='info-item cross-center dir-left-nowrap'>
  62. <view class="form-label">货号</view>
  63. <view class='dir-left-nowrap price-input cross-center'>
  64. <input
  65. :focus="inputNo && chooseIndex == item.id"
  66. @blur="noBlur(item.id,$event)"
  67. v-if="inputNo && chooseIndex == item.id"
  68. placeholder-style="color: #cdcdcd"
  69. placeholder="请输入货号"
  70. class='input'
  71. :value="item.no"
  72. />
  73. <view v-else :class="item.no ? 'input input-item' : 'input input-item placeholder'" @click="noBlur(item.id)">{{item.no ? item.no :'请输入货号'}}</view>
  74. </view>
  75. </view>
  76. <view class='info-item cross-center dir-left-nowrap'>
  77. <view class="form-label">重量</view>
  78. <view class='dir-left-nowrap cross-center price-input'>
  79. <input
  80. :focus="inputWeight && chooseIndex == item.id"
  81. @blur="weightBlur(item.id,$event)"
  82. v-if="inputWeight && chooseIndex == item.id"
  83. placeholder-style="color: #cdcdcd"
  84. placeholder="请输入重量"
  85. type='digit'
  86. class='input'
  87. :value="item.weight"
  88. />
  89. <view v-else :class="item.weight ? 'input input-item' : 'input input-item placeholder'" @click="weightBlur(item.id)">{{item.weight ? item.weight :'请输入重量'}}</view>
  90. <view>g</view>
  91. </view>
  92. </view>
  93. </view>
  94. </template>
  95. </view>
  96. </view>
  97. <view :class="['placeholder', `${iphone_x? 'iphone_x':''}`]"></view>
  98. <view :class="['bottom', 'cross-center', 'dir-left-nowrap', `${iphone_x? 'iphone_x':''}`]">
  99. <view @click="allSelect" class="check">
  100. <image src="/static/image/icon/icon-uncheck.png" v-if="!selectStatus"></image>
  101. <image src="./../image/active.png" v-else></image>
  102. </view>
  103. <view>全选</view>
  104. <view @click="allSetting" class="all-setting">批量设置</view>
  105. <view @click="save" :class="['save-btn', `${iphone_x? 'iphone_x':''}`]">保存</view>
  106. </view>
  107. <view @touchmove.stop.prevent="" :class="['bg', `${showSetting? 'again':''}`]" v-if="showGroup || showSetting">
  108. <view class="dialog-group" v-if="showGroup">
  109. <view @click="confirm(-1)" class="dialog-group-name t-omit">{{ '全部' + chooseGroup.attr_group_name}}</view>
  110. <view @click="confirm(index,item)" v-for="(item,index) in chooseGroup.attr_list" :key="item.attr_id" :class="['dialog-group-name', 't-omit', `${item.choose? 'active':''}`]">{{item.attr_name}}</view>
  111. </view>
  112. <view :class="['dialog-setting', `${iphone_x? 'iphone_x':''}`]" v-if="showSetting">
  113. <view class="dialog-setting-title main-between cross-center">
  114. <view @click="close" class="dialog-setting-btn">取消</view>
  115. <view>批量设置</view>
  116. <view @click="settingSubmit" class="dialog-setting-btn">确定</view>
  117. </view>
  118. <view style="background-color: #fff">
  119. <view class='info-item cross-center dir-left-nowrap'>
  120. <view class="form-label">售价</view>
  121. <view class='dir-left-nowrap price-input cross-center main-between'>
  122. <input @input="settingValue($event,'price')" placeholder-style="color: #cdcdcd" placeholder="请输入售价" type='digit' class='input'/>
  123. <view>元</view>
  124. </view>
  125. </view>
  126. <view class='info-item cross-center dir-left-nowrap'>
  127. <view class="form-label">库存</view>
  128. <view class='dir-left-nowrap price-input cross-center main-between'>
  129. <input @input="settingValue($event,'stock')" placeholder-style="color: #cdcdcd" placeholder="请输入库存" type='number' class='input unit'/>
  130. <view class="unit-width">{{unit}}</view>
  131. </view>
  132. </view>
  133. <view class='info-item cross-center dir-left-nowrap'>
  134. <view class="form-label">货号</view>
  135. <view class='dir-left-nowrap price-input cross-center'>
  136. <input @input="settingValue($event,'no')" placeholder-style="color: #cdcdcd" placeholder="请输入货号" class='input'/>
  137. </view>
  138. </view>
  139. <view class='info-item cross-center dir-left-nowrap'>
  140. <view class="form-label">重量</view>
  141. <view class='dir-left-nowrap cross-center price-input'>
  142. <input @input="settingValue($event,'weight')" placeholder-style="color: #cdcdcd" placeholder="请输入重量" type='number' class='input'/>
  143. <view>g</view>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. </app-layout>
  150. </template>
  151. <script>
  152. export default {
  153. data() {
  154. return {
  155. iphone_x: false,
  156. attr_groups: [],
  157. attr_list: [],
  158. unit: '件',
  159. attr: [],
  160. select: false,
  161. chooseAttr: {},
  162. chooseGroup: {},
  163. chooseList: [],
  164. selectList: [],
  165. selectStatus: false,
  166. chooseIndex: -1,
  167. listLength: 0,
  168. showGroup: false,
  169. showSetting: false,
  170. inputName: false,
  171. inputStock: false,
  172. inputNo: false,
  173. inputWeight: false,
  174. startIndex: -10,
  175. endIndex: 90,
  176. setting: {
  177. price: '',
  178. stock: '',
  179. no: '',
  180. weight: '',
  181. },
  182. groupIndex: -1
  183. }
  184. },
  185. methods: {
  186. settingValue(e, name) {
  187. let value = e.detail.value;
  188. switch (name) {
  189. case 'price':
  190. this.setting.price = value;
  191. break;
  192. case 'stock':
  193. this.setting.stock = value;
  194. break;
  195. case 'no':
  196. this.setting.no = value;
  197. break;
  198. case 'weight':
  199. this.setting.weight = value;
  200. break;
  201. }
  202. },
  203. nameBlur(id,e) {
  204. if(!e) {
  205. this.inputName = true;
  206. this.inputStock = false;
  207. this.inputNo = false;
  208. this.inputWeight = false;
  209. this.chooseIndex = id;
  210. }else {
  211. this.inputName = false;
  212. this.attr[id].price = this.money(e.detail.value);
  213. }
  214. },
  215. stockBlur(id,e) {
  216. if(!e) {
  217. this.inputStock = true;
  218. this.inputName = false;
  219. this.inputNo = false;
  220. this.inputWeight = false;
  221. this.chooseIndex = id;
  222. }else {
  223. this.inputStock = false;
  224. this.attr[id].stock = e.detail.value;
  225. }
  226. },
  227. noBlur(id,e) {
  228. if(!e) {
  229. this.inputNo = true;
  230. this.inputName = false;
  231. this.inputStock = false;
  232. this.inputWeight = false;
  233. this.chooseIndex = id;
  234. }else {
  235. this.inputNo = false;
  236. this.attr[id].no = e.detail.value;
  237. }
  238. },
  239. weightBlur(id,e) {
  240. if(!e) {
  241. this.inputWeight = true;
  242. this.inputName = false;
  243. this.inputStock = false;
  244. this.inputNo = false;
  245. this.chooseIndex = id;
  246. }else {
  247. this.inputWeight = false;
  248. this.attr[id].weight = e.detail.value;
  249. }
  250. },
  251. money(val) {
  252. let num = val.toString(); //先转换成字符串类型
  253. if (num.indexOf('.') === 0) { //第一位就是 .
  254. num = '0' + num
  255. }
  256. num = num.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
  257. num = num.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
  258. num = num.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  259. num = num.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
  260. if (num.indexOf(".") < 0 && num != "") {
  261. num = parseFloat(num);
  262. }
  263. return num
  264. },
  265. allSetting() {
  266. let select = false;
  267. for(let i in this.attr) {
  268. if(this.attr[i].select) {
  269. select = true
  270. }
  271. }
  272. if(select) {
  273. this.showSetting = true;
  274. }else {
  275. uni.showToast({
  276. title: '请选择规格',
  277. icon: 'none',
  278. duration: 1000
  279. });
  280. }
  281. },
  282. settingSubmit() {
  283. for(let i in this.attr) {
  284. if(this.attr[i].select) {
  285. if(this.setting.price) {
  286. this.attr[i].price = this.money(this.setting.price)
  287. this.$forceUpdate();
  288. }
  289. if(this.setting.stock) {
  290. this.attr[i].stock = this.setting.stock
  291. this.$forceUpdate();
  292. }
  293. if(this.setting.no) {
  294. this.attr[i].no = this.setting.no
  295. this.$forceUpdate();
  296. }
  297. if(this.setting.weight) {
  298. this.attr[i].weight = this.setting.weight
  299. this.$forceUpdate();
  300. }
  301. }
  302. }
  303. this.close();
  304. },
  305. close() {
  306. this.showSetting = false;
  307. this.setting.stock = '';
  308. this.setting.price = '';
  309. this.setting.no = '';
  310. this.setting.weight = '';
  311. },
  312. unSelect(item,index) {
  313. this.attr[index].select = !this.attr[index].select;
  314. let select = true;
  315. for(let i in this.attr) {
  316. if(!this.attr[i].select) {
  317. select = false;
  318. }
  319. }
  320. this.selectStatus = select;
  321. this.$forceUpdate();
  322. },
  323. allSelect() {
  324. this.selectStatus = !this.selectStatus;
  325. for(let i in this.attr) {
  326. this.attr[i].select = !this.selectStatus;
  327. if(this.attr[i].show == this.listLength) {
  328. this.attr[i].select = this.selectStatus;
  329. }
  330. }
  331. },
  332. save() {
  333. let that = this;
  334. let pass = true;
  335. for(let i in that.attr) {
  336. if(!that.attr[i].price || !that.attr[i].stock) {
  337. pass = false;
  338. uni.showToast({
  339. title: '请填写规格信息',
  340. icon: 'none',
  341. duration: 1000
  342. });
  343. return false;
  344. }
  345. }
  346. if(pass) {
  347. uni.showLoading({
  348. mask: true,
  349. title: '保存中...'
  350. });
  351. this.$storage.setStorage({
  352. key: "temp_attr_info",
  353. data: that.attr,
  354. success() {
  355. uni.hideLoading();
  356. setTimeout(() => {
  357. uni.navigateBack();
  358. }, 500);
  359. },
  360. fail(res) {
  361. uni.hideLoading();
  362. uni.showToast({
  363. title: res.errMsg,
  364. icon: 'none',
  365. duration: 1000
  366. });
  367. }
  368. })
  369. }
  370. },
  371. choose(item,index) {
  372. this.chooseGroup = item;
  373. if(this.groupIndex != index) {
  374. this.showGroup = true;
  375. this.groupIndex = index;
  376. }else {
  377. this.showGroup = !this.showGroup;
  378. }
  379. },
  380. confirm(index,item) {
  381. this.showGroup = false;
  382. for(let i in this.attr_groups[this.groupIndex].attr_list) {
  383. this.attr_groups[this.groupIndex].attr_list[i].choose = false;
  384. }
  385. if(index > -1) {
  386. this.chooseAttr = item;
  387. item.attr_groups_id = this.attr_groups[this.groupIndex].attr_groups_id;
  388. this.attr_groups[this.groupIndex].attr_list[index].choose = true;
  389. this.attr_groups[this.groupIndex].choose = true;
  390. this.attr_groups[this.groupIndex].choose_attr = this.attr_groups[this.groupIndex].attr_list[index].attr_name;
  391. }else {
  392. this.chooseGroup = {};
  393. this.chooseAttr = {};
  394. this.attr_groups[this.groupIndex].choose = false;
  395. this.attr_groups[this.groupIndex].choose_attr = '';
  396. }
  397. this.chooseList = [];
  398. for(let i in this.attr_groups) {
  399. if(this.attr_groups[i].choose) {
  400. for(let j in this.attr_groups[i].attr_list) {
  401. if(this.attr_groups[i].attr_list[j].choose) {
  402. let {attr_group_id, attr_group_name, attr_list} = this.attr_groups[i];
  403. this.chooseList.push({
  404. attr_group_id: attr_group_id,
  405. attr_group_name: attr_group_name,
  406. attr_id: attr_list[j].attr_id,
  407. attr_name: attr_list[j].attr_name
  408. });
  409. }
  410. }
  411. }
  412. }
  413. this.listLength = this.chooseList.length;
  414. let select = false;
  415. let showIndex = -1;
  416. for(let x in this.attr) {
  417. this.attr[x].show = 0;
  418. this.attr[x].choose = [];
  419. this.attr[x].showIndex = -200;
  420. if(this.chooseList.length > 0) {
  421. for(let y in this.attr[x].attr_list) {
  422. for(let i in this.chooseList) {
  423. let { attr_group_id, attr_id } = this.attr[x].attr_list[y];
  424. if(attr_group_id == this.chooseList[i].attr_group_id && attr_id == this.chooseList[i].attr_id) {
  425. this.attr[x].choose.push(this.chooseList[i].attr_name);
  426. this.attr[x].choose = Array.from(new Set(this.attr[x].choose));
  427. this.attr[x].show = this.attr[x].choose.length;
  428. this.attr[x].showIndex = showIndex;
  429. select = true;
  430. this.$forceUpdate();
  431. }
  432. }
  433. }
  434. }else {
  435. this.attr[x].showIndex = x;
  436. }
  437. }
  438. if(!select) {
  439. for(let x in this.attr) {
  440. this.attr[x].choose = [];
  441. this.attr[x].show = this.attr[x].choose.length;
  442. }
  443. }else {
  444. for(let x in this.attr) {
  445. if(this.attr[x].show == this.listLength) {
  446. showIndex++;
  447. this.attr[x].showIndex = showIndex;
  448. }
  449. }
  450. }
  451. this.startIndex = -10;
  452. this.endIndex = 90;
  453. uni.pageScrollTo({
  454. scrollTop: 0,
  455. duration: 300
  456. });
  457. },
  458. saveData(obj1,obj2,obj3,obj4,obj5) {
  459. let obj = {};
  460. obj.attr_list = []
  461. obj.stock = '';
  462. obj.price = '';
  463. obj.no = '';
  464. obj.weight = '';
  465. obj.pic_url = '';
  466. obj.shareLevelList = [];
  467. obj.member_price = {};
  468. obj.attr_list.push(obj1)
  469. if(obj2) {
  470. obj.attr_list.push(obj2);
  471. }
  472. if(obj3) {
  473. obj.attr_list.push(obj3);
  474. }
  475. if(obj4) {
  476. obj.attr_list.push(obj4);
  477. }
  478. if(obj5) {
  479. obj.attr_list.push(obj5);
  480. }
  481. this.attr.push(obj);
  482. this.$hideLoading();
  483. },
  484. },
  485. onPageScroll (e) {
  486. let that = this;
  487. that.startIndex = Math.floor((e.scrollTop-50) / 250) - 150; // 取得可见区域的起始数据索引
  488. that.endIndex = that.startIndex + 300; // 取得可见区域的结束数据索引
  489. },
  490. onLoad() { this.$commonLoad.onload();
  491. let that = this;
  492. that.$showLoading({
  493. type: 'global',
  494. text: '加载中...'
  495. });
  496. that.unit = that.$storage.getStorageSync('goods_unit') ? that.$storage.getStorageSync('goods_unit') : '件';
  497. if(that.$storage.getStorageSync('temp_attr_info')) {
  498. that.attr_groups = that.$storage.getStorageSync('temp_attr');
  499. that.attr_list[0] = [];
  500. that.attr = that.$storage.getStorageSync('temp_attr_info');
  501. for(let i in that.attr) {
  502. that.attr[i].show = 0;
  503. that.attr[i].choose = [];
  504. that.attr[i].id = i;
  505. that.attr[i].select = false;
  506. that.attr[i].showIndex = i;
  507. }
  508. that.$hideLoading();
  509. }else {
  510. if(that.$storage.getStorageSync('temp_attr')) {
  511. that.attr_groups = that.$storage.getStorageSync('temp_attr');
  512. that.attr = [];
  513. for(let i = 0;i < that.attr_groups[0].attr_list.length;i++) {
  514. let first = {
  515. attr_group_id: that.attr_groups[0].attr_group_id,
  516. attr_group_name: that.attr_groups[0].attr_group_name,
  517. attr_id: that.attr_groups[0].attr_list[i].attr_id,
  518. attr_name: that.attr_groups[0].attr_list[i].attr_name,
  519. }
  520. if(that.attr_groups.length === 1) {
  521. that.saveData(first);
  522. }else {
  523. for(let j = 0;j < that.attr_groups[1].attr_list.length;j++) {
  524. let second = {
  525. attr_group_id: that.attr_groups[1].attr_group_id,
  526. attr_group_name: that.attr_groups[1].attr_group_name,
  527. attr_id: that.attr_groups[1].attr_list[j].attr_id,
  528. attr_name: that.attr_groups[1].attr_list[j].attr_name,
  529. }
  530. if(that.attr_groups.length === 2) {
  531. that.saveData(first,second);
  532. }else {
  533. for(let x = 0;x < that.attr_groups[2].attr_list.length;x++) {
  534. let third = {
  535. attr_group_id: that.attr_groups[2].attr_group_id,
  536. attr_group_name: that.attr_groups[2].attr_group_name,
  537. attr_id: that.attr_groups[2].attr_list[x].attr_id,
  538. attr_name: that.attr_groups[2].attr_list[x].attr_name,
  539. }
  540. if(that.attr_groups.length === 3) {
  541. that.saveData(first,second,third);
  542. }else {
  543. for(let y = 0;y < that.attr_groups[3].attr_list.length;y++) {
  544. let fourth = {
  545. attr_group_id: that.attr_groups[3].attr_group_id,
  546. attr_group_name: that.attr_groups[3].attr_group_name,
  547. attr_id: that.attr_groups[3].attr_list[y].attr_id,
  548. attr_name: that.attr_groups[3].attr_list[y].attr_name,
  549. }
  550. if(that.attr_groups.length === 4) {
  551. that.saveData(first,second,third,fourth);
  552. that.$hideLoading();
  553. }else {
  554. for(let z = 0;z < that.attr_groups[4].attr_list.length;z++) {
  555. let fifth = {
  556. attr_group_id: that.attr_groups[4].attr_group_id,
  557. attr_group_name: that.attr_groups[4].attr_group_name,
  558. attr_id: that.attr_groups[4].attr_list[z].attr_id,
  559. attr_name: that.attr_groups[4].attr_list[z].attr_name,
  560. }
  561. that.saveData(first,second,third,fourth,fifth);
  562. }
  563. }
  564. }
  565. }
  566. }
  567. }
  568. }
  569. }
  570. }
  571. for(let i in that.attr) {
  572. that.attr[i].show = 0;
  573. that.attr[i].choose = [];
  574. that.attr[i].id = i;
  575. that.attr[i].showIndex = i;
  576. }
  577. }
  578. }
  579. uni.getSystemInfo({
  580. success: function (res) {
  581. if(res.model.indexOf('iPhone X') > -1 || res.model.indexOf('iPhone 11') > -1 || res.model.indexOf('iPhone11') > -1 || res.model.indexOf('iPhone12') > -1 || res.model.indexOf('Unknown Device') > -1) {
  582. that.iphone_x = true;
  583. }
  584. }
  585. })
  586. }
  587. }
  588. </script>
  589. <style scoped lang="scss">
  590. .checked-icon {
  591. background-color: #446dfd;
  592. }
  593. .attr-group-holder {
  594. height: #{100rpx};
  595. }
  596. .group {
  597. position: fixed;
  598. top: 0;
  599. left: 0;
  600. width: 100%;
  601. height: #{100rpx};
  602. background-color: #fff;
  603. z-index: 100;
  604. .group-item {
  605. height: #{50rpx};
  606. border-left: #{2rpx} solid #e2e2e2;
  607. .group-name {
  608. width: #{86rpx};
  609. font-size: #{28rpx};
  610. color: #353535;
  611. text-align: right;
  612. &.active {
  613. color: #446dfd;
  614. }
  615. }
  616. .more {
  617. display: block;
  618. width: #{22rpx};
  619. height: #{12rpx};
  620. margin-left: #{12rpx};
  621. }
  622. }
  623. .group-item:first-of-type {
  624. border-left: 0;
  625. }
  626. }
  627. .attr-item {
  628. min-height: 445rpx;
  629. .attr-name {
  630. padding: #{24rpx};
  631. padding-left: #{96rpx};
  632. position: relative;
  633. font-size: #{28rpx};
  634. color: #353535;
  635. .check {
  636. width: #{84rpx};
  637. height: #{76rpx};
  638. padding: #{20rpx} #{24rpx};
  639. position: absolute;
  640. top: 0;
  641. left: 0;
  642. image {
  643. width: #{36rpx};
  644. height: #{36rpx};
  645. }
  646. }
  647. .attr-group {
  648. padding-right: #{24rpx};
  649. height: #{30rpx};
  650. line-height: #{26rpx};
  651. border-right: #{2rpx} solid #999999;
  652. margin-right: #{24rpx};
  653. margin-bottom: #{8rpx};
  654. .attr-group-name {
  655. color: #999999;
  656. }
  657. }
  658. .attr-group:last-of-type {
  659. border-right: 0;
  660. }
  661. }
  662. }
  663. .info-item {
  664. border-top: #{1rpx} solid #e2e2e2;
  665. height: #{88rpx};
  666. line-height: #{88rpx};
  667. font-size: #{28rpx};
  668. color: #353535;
  669. margin: 0 24rpx;
  670. .form-label {
  671. width: #{176rpx};
  672. }
  673. .input {
  674. width: #{476rpx};
  675. background-color: #fff;
  676. padding-left: #{25rpx};
  677. font-size: #{28rpx};
  678. &.input-item {
  679. height: #{80rpx};
  680. line-height: #{80rpx};
  681. white-space: nowrap;
  682. overflow: auto;
  683. &.placeholder {
  684. color: #cdcdcd;
  685. }
  686. }
  687. }
  688. .input.unit {
  689. width: #{396rpx};
  690. }
  691. .unit-width {
  692. width: #{112rpx};
  693. text-align: right;
  694. }
  695. }
  696. .info-item:first-of-type {
  697. border-top: 0;
  698. }
  699. .bottom {
  700. position: fixed;
  701. bottom: 0;
  702. left: 0;
  703. width: 100%;
  704. height: #{120rpx};
  705. background-color: #fff;
  706. padding: 0 #{24rpx};
  707. font-size: #{28rpx};
  708. z-index: 10;
  709. color: #353535;
  710. .check {
  711. width: #{84rpx};
  712. height: #{84rpx};
  713. padding: #{24rpx};
  714. image {
  715. width: #{36rpx};
  716. height: #{36rpx};
  717. }
  718. }
  719. .all-setting {
  720. color: #446dfd;
  721. margin-left: #{40rpx};
  722. }
  723. .save-btn {
  724. position: absolute;
  725. right: #{24rpx};
  726. bottom: #{20rpx};
  727. height: #{80rpx};
  728. line-height: #{80rpx};
  729. width: #{280rpx};
  730. text-align: center;
  731. border-radius: #{40rpx};
  732. background-color: #446dfd;
  733. font-size: #{32rpx};
  734. color: #ffffff;
  735. font-weight: bold;
  736. &.iphone_x {
  737. bottom: #{70rpx};
  738. }
  739. }
  740. }
  741. .bottom.iphone_x {
  742. height: #{170rpx};
  743. padding-bottom: #{50rpx};
  744. }
  745. .placeholder {
  746. height: #{140rpx};
  747. }
  748. .placeholder.iphone_x {
  749. height: #{190rpx};
  750. }
  751. .bg {
  752. position: fixed;
  753. left: 0;
  754. top: 0;
  755. width: 100%;
  756. height: 100%;
  757. background-color: rgba(0,0,0,.3);
  758. z-index: 80;
  759. &.again {
  760. z-index: 120;
  761. }
  762. .dialog-group {
  763. position: fixed;
  764. top: #{100rpx};
  765. width: 100%;
  766. border-top: #{2rpx} solid #e2e2e2;
  767. background-color: #fff;
  768. padding-left: #{24rpx};
  769. .dialog-group-name {
  770. height: #{88rpx};
  771. line-height: #{88rpx};
  772. font-size: #{28rpx};
  773. color: #353535;
  774. &.active {
  775. color: #446dfd;
  776. }
  777. }
  778. }
  779. .dialog-setting {
  780. position: fixed;
  781. bottom: 0;
  782. left: 0;
  783. width: 100%;
  784. z-index: 122;
  785. &.iphone_x {
  786. padding-bottom: #{50rpx};
  787. }
  788. .dialog-setting-title {
  789. border-top-left-radius: #{16rpx};
  790. border-top-right-radius: #{16rpx};
  791. background-color: #f7f7f7;
  792. height: #{88rpx};
  793. font-size: #{32rpx};
  794. color: #353535;
  795. padding: 0 #{24rpx};
  796. .dialog-setting-btn {
  797. color: #446dfd;
  798. }
  799. }
  800. }
  801. }
  802. </style>