people.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <view class="box">
  3. <view style="height: 20rpx;"></view>
  4. <view class="line" v-for="(item,index) in list">
  5. <view class="linetop">
  6. <view class="name">{{item.CustomerName}}</view>
  7. <view class="nickNameBox">
  8. <image src="../../static/timg/icon_wechat.png" mode="" class="nickNameImg"></image>
  9. <view class="nickName">{{item.WxNickName?item.WxNickName:''}}</view>
  10. </view>
  11. </view>
  12. <view class="lineCOnt">
  13. <view class="lineline">
  14. <view class="lineContLeft">
  15. <image src="../../static/timg/icon_dianhua.png" mode="" class="lineContLeftImg"></image>
  16. <view class="lineContLeftMs">{{item.MobilePhone}}</view>
  17. </view>
  18. <view class="lineTIme">{{item.PJCreateTime}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. <nodata v-if="list.length==0"></nodata>
  23. <!-- 手机号授权 -->
  24. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  25. <view class="authorizCont" @click.stop="">
  26. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  27. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  28. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  29. </view>
  30. <view style="text-align: center;padding-top: 56rpx;">
  31. <image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import nodata from '../../components/nodata/nodata.vue'
  38. export default {
  39. components: {
  40. nodata
  41. },
  42. data() {
  43. return {
  44. list:[],
  45. themeColor:'',
  46. userInfo:'',
  47. page:1,
  48. limit:20,
  49. authorizShow:false,
  50. userInfo:'',
  51. ext:'',
  52. wxOpenData:'',
  53. }
  54. },
  55. onLoad(opt) {
  56. this.themeColor = uni.getStorageSync("themeColor");
  57. this.userInfo=this.$store.state.userInfo;
  58. this.ext=this.$common.getExtStoreId();
  59. if(this.userInfo){
  60. this.getList()
  61. }else{
  62. this.$common.automaticlogin().then(val => {
  63. this.userInfo=this.$store.state.userInfo;
  64. this.wxOpenData=this.$store.state.wxOpenData;
  65. this.themeColor = uni.getStorageSync("themeColor");
  66. this.getList()
  67. })
  68. }
  69. //this.getList()
  70. },
  71. onShow() {
  72. },
  73. methods: {
  74. getList(){
  75. uni.showLoading({
  76. title: '加载中'
  77. })
  78. this.$http('opencarInfoOwner/listPJBonusPage', {
  79. page:this.page,limit:this.limit,
  80. }, 'GET').then(res => {
  81. uni.hideLoading();
  82. console.log(res.data)
  83. var data=res.data.Items;
  84. this.list=this.list.concat(data);
  85. //this.list = res.data.Items
  86. //console.log('list+=', this.queryShopList);
  87. })
  88. },
  89. decryptPhoneNumber: function(e) {
  90. console.log(e);
  91. this.code=e.detail.code
  92. this.wxPhoneLogin()
  93. this.authorizShow=false;
  94. },
  95. wxPhoneLogin(){
  96. var that=this;
  97. this.$http('miniApp2/sys/wxPhoneLogin', {
  98. appId:this.ext.appId,
  99. unionId:this.ext.unionId,
  100. code:this.code,
  101. openId:this.wxOpenData.openid
  102. },'POST').then(res => {
  103. var data = res.data;
  104. if(data.loginInfo){
  105. this.userInfo=data.loginInfo.openUser;
  106. this.wxOpenData=data.loginInfo;
  107. this.$store.commit('mutationswxOpenData', data.loginInfo)
  108. this.$store.commit('mutationsuserInfo', this.userInfo)
  109. this.list=[]
  110. this.getList()
  111. }
  112. })
  113. },
  114. },
  115. onReachBottom(){
  116. this.page++;
  117. this.getList()
  118. //console.log("shanglas")
  119. },
  120. onPullDownRefresh(){
  121. this.page=1;
  122. this.list=[];
  123. this.getList();
  124. setTimeout(() => {
  125. uni.stopPullDownRefresh(); // 关闭下拉刷新
  126. }, 2000);
  127. }
  128. }
  129. </script>
  130. <style scoped lang="less">
  131. .box {
  132. width: 100vw;
  133. min-height: 100vh;
  134. background: #F4F5F7;
  135. }
  136. .nickNameBox{
  137. display: flex;
  138. padding-top: 6rpx;
  139. }
  140. .nickName{
  141. font-weight: 400;
  142. color: #999999;
  143. font-size: 24rpx;
  144. line-height: 30rpx;
  145. padding-left: 10rpx;
  146. }
  147. .lineContLeftImg{
  148. width: 30rpx;
  149. height: 30rpx;
  150. margin-right: 10rpx;
  151. }
  152. .line{
  153. width: 702rpx;
  154. background: #FFFFFF;
  155. border-radius: 10rpx;
  156. margin-bottom: 20rpx;
  157. margin-left: 24rpx;
  158. }
  159. .linetop{
  160. display: flex;
  161. justify-content: space-between;
  162. font-size: 30rpx;
  163. padding: 20rpx;
  164. padding-bottom: 0;
  165. }
  166. .lineline{
  167. display: flex;
  168. justify-content: space-between;
  169. padding: 20rpx;
  170. font-weight: 400;
  171. color: #999999;
  172. font-size: 24rpx;
  173. line-height: 30rpx;
  174. }
  175. .lineContLeft{
  176. display: flex;
  177. }
  178. .name{
  179. font-weight: 500;
  180. color: #3C3C3C;
  181. }
  182. .amount{
  183. color: #FF0000;
  184. }
  185. .nickNameImg{
  186. width: 30rpx;
  187. height: 30rpx;
  188. }
  189. .authorizBox{
  190. width: 100vw;
  191. height: 100vh;
  192. background: rgba(0, 0, 0, 0.5);
  193. position: fixed;
  194. top: 0;
  195. left: 0;
  196. }
  197. .authorizCont{
  198. margin-top: 30vh;
  199. width: 564rpx;
  200. height: 408rpx;
  201. background: #FFFFFF;
  202. border-radius: 24rpx;
  203. margin-left: 93rpx;
  204. position: relative;
  205. }
  206. .authorizCloseImg{
  207. width: 62rpx;
  208. height: 62rpx;
  209. }
  210. .sqLogoBox{
  211. width: 180rpx;
  212. height: 180rpx;
  213. background: #FFFFFF;
  214. border-radius: 90rpx;
  215. text-align: center;
  216. position: absolute;
  217. top: -50rpx;
  218. left: 192rpx;
  219. }
  220. .authorizName{
  221. color: #333333;
  222. line-height: 42rpx;
  223. font-size: 30rpx;
  224. text-align: center;
  225. padding-top: 58rpx;
  226. }
  227. .authorizMs{
  228. color: #999999;
  229. line-height: 36rpx;
  230. font-size: 26rpx;
  231. width: 452rpx;
  232. padding-top: 24rpx;
  233. text-align: center;
  234. margin-left: 56rpx;
  235. }
  236. .authorizContbutton{
  237. width: 422rpx;
  238. height: 88rpx;
  239. background: #D53533;
  240. border-radius: 44rpx;
  241. line-height: 88rpx;
  242. text-align: center;
  243. font-size:30rpx;
  244. color: #FFFFFF;
  245. margin-top: 62rpx;
  246. margin-left:71rpx;
  247. }
  248. </style>